mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
f2fs: fix to add missing iput() in gc_data_segment()
[ Upstream commita798ff17cd
] During gc_data_segment(), if inode state is abnormal, it missed to call iput(), fix it. Fixes:b73e52824c
("f2fs: reposition unlock_new_inode to prevent accessing invalid inode") Fixes:9056d6489f
("f2fs: fix to do sanity check on inode type during garbage collection") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
14cdd01c7b
commit
4b3d568d40
@ -1566,10 +1566,15 @@ next_step:
|
||||
int err;
|
||||
|
||||
inode = f2fs_iget(sb, dni.ino);
|
||||
if (IS_ERR(inode) || is_bad_inode(inode) ||
|
||||
special_file(inode->i_mode))
|
||||
if (IS_ERR(inode))
|
||||
continue;
|
||||
|
||||
if (is_bad_inode(inode) ||
|
||||
special_file(inode->i_mode)) {
|
||||
iput(inode);
|
||||
continue;
|
||||
}
|
||||
|
||||
err = f2fs_gc_pinned_control(inode, gc_type, segno);
|
||||
if (err == -EAGAIN) {
|
||||
iput(inode);
|
||||
|
Loading…
Reference in New Issue
Block a user