diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-16 20:18:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-10-16 20:18:18 -0400 |
commit | 0056019da4b7ee5ab51fb174fe0655278578516f (patch) | |
tree | b56f6c2077120be03499d651c47a485408d1498f /fs | |
parent | 8359ffa56595b5b56ea690810cace53e13618269 (diff) | |
parent | 43ae9e3fc70ca0057ae0a24ef5eedff05e3fae06 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull tmpfile fix from Al Viro:
"A fix for double iput() in ->tmpfile() on ext3 and ext4; I'd fucked it
up, Miklos has caught it"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
ext[34]: fix double put in tmpfile
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext3/namei.c | 5 | ||||
-rw-r--r-- | fs/ext4/namei.c | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 1194b1f0f839..f8cde46de9cd 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -1783,7 +1783,7 @@ retry: | |||
1783 | d_tmpfile(dentry, inode); | 1783 | d_tmpfile(dentry, inode); |
1784 | err = ext3_orphan_add(handle, inode); | 1784 | err = ext3_orphan_add(handle, inode); |
1785 | if (err) | 1785 | if (err) |
1786 | goto err_drop_inode; | 1786 | goto err_unlock_inode; |
1787 | mark_inode_dirty(inode); | 1787 | mark_inode_dirty(inode); |
1788 | unlock_new_inode(inode); | 1788 | unlock_new_inode(inode); |
1789 | } | 1789 | } |
@@ -1791,10 +1791,9 @@ retry: | |||
1791 | if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) | 1791 | if (err == -ENOSPC && ext3_should_retry_alloc(dir->i_sb, &retries)) |
1792 | goto retry; | 1792 | goto retry; |
1793 | return err; | 1793 | return err; |
1794 | err_drop_inode: | 1794 | err_unlock_inode: |
1795 | ext3_journal_stop(handle); | 1795 | ext3_journal_stop(handle); |
1796 | unlock_new_inode(inode); | 1796 | unlock_new_inode(inode); |
1797 | iput(inode); | ||
1798 | return err; | 1797 | return err; |
1799 | } | 1798 | } |
1800 | 1799 | ||
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 1bec5a5c1e45..5a0408d7b114 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -2319,7 +2319,7 @@ retry: | |||
2319 | d_tmpfile(dentry, inode); | 2319 | d_tmpfile(dentry, inode); |
2320 | err = ext4_orphan_add(handle, inode); | 2320 | err = ext4_orphan_add(handle, inode); |
2321 | if (err) | 2321 | if (err) |
2322 | goto err_drop_inode; | 2322 | goto err_unlock_inode; |
2323 | mark_inode_dirty(inode); | 2323 | mark_inode_dirty(inode); |
2324 | unlock_new_inode(inode); | 2324 | unlock_new_inode(inode); |
2325 | } | 2325 | } |
@@ -2328,10 +2328,9 @@ retry: | |||
2328 | if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) | 2328 | if (err == -ENOSPC && ext4_should_retry_alloc(dir->i_sb, &retries)) |
2329 | goto retry; | 2329 | goto retry; |
2330 | return err; | 2330 | return err; |
2331 | err_drop_inode: | 2331 | err_unlock_inode: |
2332 | ext4_journal_stop(handle); | 2332 | ext4_journal_stop(handle); |
2333 | unlock_new_inode(inode); | 2333 | unlock_new_inode(inode); |
2334 | iput(inode); | ||
2335 | return err; | 2334 | return err; |
2336 | } | 2335 | } |
2337 | 2336 | ||