diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-06-23 10:36:08 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-08-04 14:09:53 -0700 |
commit | c9b63bd01dd8da096d079c490771ad8a049fd480 (patch) | |
tree | b6fda13486d2aec3011a7ceafa3755304eda6ec1 /fs/f2fs/namei.c | |
parent | eca616f8c1d6c581f3785f0ee3e2a3887e084273 (diff) | |
download | lwn-c9b63bd01dd8da096d079c490771ad8a049fd480.tar.gz lwn-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.c | 4 |
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); } |