summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2021-09-28 22:19:14 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2021-10-12 02:15:23 +0300
commitcd6d697a6e2013a0a85f8b261b16c8cfd50c1f5f (patch)
treee5858921a4733e3fb7badd674b3a1b9267fcd6da /fs/f2fs
parent011e0868e0cf1237675b22e36fffa958fb08f46e (diff)
downloadlinux-cd6d697a6e2013a0a85f8b261b16c8cfd50c1f5f.tar.xz
f2fs: fix wrong condition to trigger background checkpoint correctly
In f2fs_balance_fs_bg(), it needs to check both NAT_ENTRIES and INO_ENTRIES memory usage to decide whether we should skip background checkpoint, otherwise we may always skip checking INO_ENTRIES memory usage, so that INO_ENTRIES may potentially cause high memory footprint. Fixes: 493720a48543 ("f2fs: fix to avoid REQ_TIME and CP_TIME collision") Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/segment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index f3f4dee43985..3189537a19dc 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -580,7 +580,7 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg)
goto do_sync;
/* checkpoint is the only way to shrink partial cached entries */
- if (f2fs_available_free_memory(sbi, NAT_ENTRIES) ||
+ if (f2fs_available_free_memory(sbi, NAT_ENTRIES) &&
f2fs_available_free_memory(sbi, INO_ENTRIES))
return;