]> git.ipfire.org Git - thirdparty/kernel/stable.git/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>
Sun, 21 Aug 2022 13:16:11 +0000 (15:16 +0200)
[ 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 24e93fb254c5fa3b2acfbf990be19914ed426841..22bb5e07f656609a0dd0f6f6c2fc1c94a2178380 100644 (file)
@@ -1158,7 +1158,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;
        }