diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index d4662ccb94c8..5a661a0e7663 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -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);