summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/namei.c
diff options
context:
space:
mode:
authorJaegeuk Kim2015-06-23 19:36:08 +0200
committerJaegeuk Kim2015-08-04 23:09:53 +0200
commitc9b63bd01dd8da096d079c490771ad8a049fd480 (patch)
treeb6fda13486d2aec3011a7ceafa3755304eda6ec1 /fs/f2fs/namei.c
parentf2fs: avoid freed stat information (diff)
downloadkernel-qcow2-linux-c9b63bd01dd8da096d079c490771ad8a049fd480.tar.gz
kernel-qcow2-linux-c9b63bd01dd8da096d079c490771ad8a049fd480.tar.xz
kernel-qcow2-linux-c9b63bd01dd8da096d079c490771ad8a049fd480.zip
f2fs: avoid to use failed inode immediately
Before iput is called, the inode number used by a bad inode can be reassigned to other new inode, resulting in any abnormal behaviors on the new inode. This should not happen for the new inode. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/namei.c')
-rw-r--r--fs/f2fs/namei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index fdbae21ee8fb..08656fca8f83 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -78,9 +78,9 @@ out:
fail:
trace_f2fs_new_inode(inode, err);
make_bad_inode(inode);
- iput(inode);
if (nid_free)
- alloc_nid_failed(sbi, ino);
+ set_inode_flag(F2FS_I(inode), FI_FREE_NID);
+ iput(inode);
return ERR_PTR(err);
}