Commit a21c20f0 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: go out for insert_inode_locked failure

We should not call unlock_new_inode when insert_inode_locked failed.
Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 5ee5293c
...@@ -53,7 +53,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) ...@@ -53,7 +53,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
if (err) { if (err) {
err = -EINVAL; err = -EINVAL;
nid_free = true; nid_free = true;
goto out; goto fail;
} }
/* If the directory encrypted, then we should encrypt the inode. */ /* 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) ...@@ -75,9 +75,6 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
mark_inode_dirty(inode); mark_inode_dirty(inode);
return inode; return inode;
out:
clear_nlink(inode);
unlock_new_inode(inode);
fail: fail:
trace_f2fs_new_inode(inode, err); trace_f2fs_new_inode(inode, err);
make_bad_inode(inode); make_bad_inode(inode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment