[PATCH 3.16 286/366] f2fs: go out for insert_inode_locked failure
From: Ben Hutchings
Date: Sun Oct 14 2018 - 11:42:28 EST
3.16.60-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
commit a21c20f0c812925085204fced932ac95f2a76bf0 upstream.
We should not call unlock_new_inode when insert_inode_locked failed.
Reviewed-by: Chao Yu <chao2.yu@xxxxxxxxxxx>
Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
---
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);