ext[34]: fix double put in tmpfile

d_tmpfile() already swallowed the inode ref.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Miklos Szeredi 2013-10-10 16:48:19 +02:00 committed by Al Viro
parent 7dee8dff47
commit 43ae9e3fc7
2 changed files with 4 additions and 6 deletions

View File

@ -1783,7 +1783,7 @@ retry:
d_tmpfile(dentry, inode);
err = ext3_orphan_add(handle, inode);
if (err)
goto err_drop_inode;
goto err_unlock_inode;
mark_inode_dirty(inode);
unlock_new_inode(inode);
}
@ -1791,10 +1791,9 @@ retry:
if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries))
goto retry;
return err;
err_drop_inode:
err_unlock_inode:
ext3_journal_stop(handle);
unlock_new_inode(inode);
iput(inode);
return err;
}

View File

@ -2319,7 +2319,7 @@ retry:
d_tmpfile(dentry, inode);
err = ext4_orphan_add(handle, inode);
if (err)
goto err_drop_inode;
goto err_unlock_inode;
mark_inode_dirty(inode);
unlock_new_inode(inode);
}
@ -2328,10 +2328,9 @@ retry:
if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries))
goto retry;
return err;
err_drop_inode:
err_unlock_inode:
ext4_journal_stop(handle);
unlock_new_inode(inode);
iput(inode);
return err;
}