]> git.hungrycats.org Git - linux/commitdiff
f2fs: don't set GC_FAILURE_PIN for background GC
authorChao Yu <chao@kernel.org>
Sun, 20 Mar 2022 15:11:18 +0000 (23:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:21:52 +0000 (13:21 +0100)
[ Upstream commit 642c0969916eaa4878cb74f36752108e590b0389 ]

So that it can reduce the possibility that file be unpinned forcely by
foreground GC due to .i_gc_failures[GC_FAILURE_PIN] exceeds threshold.

Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/gc.c

index 7010440cb64c83251f57b958bc4e21beb3ec5c00..d016504fad4b957bd7b51b1fb9b85d369513f224 100644 (file)
@@ -1199,7 +1199,8 @@ static int move_data_block(struct inode *inode, block_t bidx,
        }
 
        if (f2fs_is_pinned_file(inode)) {
-               f2fs_pin_file_control(inode, true);
+               if (gc_type == FG_GC)
+                       f2fs_pin_file_control(inode, true);
                err = -EAGAIN;
                goto out;
        }