[PATCH 3.16 286/366] f2fs: go out for insert_inode_locked failure

Ben Hutchings
2018-10-14T15:25:41Z

From: Jaegeuk Kim <jaegeuk@kernel.org>

commit a21c20f0c812925085204fced932ac95f2a76bf0 upstream.

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
fs/f2fs/namei.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -52,15 +52,12 @@ static struct inode *f2fs_new_inode(stru
if (err) {
err = -EINVAL;
nid_free = true;
- goto out;
+ goto fail;
}
trace_f2fs_new_inode(inode, 0);
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);