summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2022-03-20 16:11:18 +0100
committerJaegeuk Kim <jaegeuk@kernel.org>2022-04-26 00:13:02 +0200
commit642c0969916eaa4878cb74f36752108e590b0389 (patch)
tree35d6140ea7449521f865a2c40ad0016d4fabcaf1 /fs/f2fs/gc.c
parentf2fs: check pinfile in gc_data_segment() in advance (diff)
downloadlinux-642c0969916eaa4878cb74f36752108e590b0389.tar.xz
linux-642c0969916eaa4878cb74f36752108e590b0389.zip
f2fs: don't set GC_FAILURE_PIN for background GC
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>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index e83c07144d8f..6a7e4148ff9d 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -1202,7 +1202,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;
}