summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2021-09-29 03:19:14 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-26 13:25:56 +0200
commitcbf2c43b36e0c439fe4c47dd1cec78b18d54e980 (patch)
treea7862df36483b2a2c7b0b3e139d7fd535ca57ab7
parent7b19858803d7f2f61449a62116721e8230e6d2fd (diff)
downloadlinux-stable-cbf2c43b36e0c439fe4c47dd1cec78b18d54e980.tar.gz
linux-stable-cbf2c43b36e0c439fe4c47dd1cec78b18d54e980.tar.bz2
linux-stable-cbf2c43b36e0c439fe4c47dd1cec78b18d54e980.zip
f2fs: fix wrong condition to trigger background checkpoint correctly
commit cd6d697a6e2013a0a85f8b261b16c8cfd50c1f5f upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 3123fd49c8ce..68774d6198a5 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -550,7 +550,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;