f2fs: go out for insert_inode_locked failure
authorJaegeuk Kim <jaegeuk@kernel.org>
Sun, 16 Aug 2015 19:38:15 +0000 (12:38 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 20 Aug 2015 16:00:13 +0000 (09:00 -0700)
We should not call unlock_new_inode when insert_inode_locked failed.

Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/namei.c

index 97e97c41b97967ea64ae8944e319dfe2b46f4366..a680bf38e4f0a70b71a9c2a4d0f376895c8b5e61 100644 (file)
@@ -53,7 +53,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
        if (err) {
                err = -EINVAL;
                nid_free = true;
-               goto out;
+               goto fail;
        }
 
        /* If the directory encrypted, then we should encrypt the inode. */
@@ -75,9 +75,6 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
        mark_inode_dirty(inode);
        return inode;
 
-out:
-       clear_nlink(inode);
-       unlock_new_inode(inode);
 fail:
        trace_f2fs_new_inode(inode, err);
        make_bad_inode(inode);