Skip to content

Commit

Permalink
f2fs: fix wrong condition to trigger background checkpoint correctly
Browse files Browse the repository at this point in the history
commit cd6d697 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: 493720a ("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>
  • Loading branch information
Chao Yu authored and Greg Kroah-Hartman committed Oct 26, 2022
1 parent 7b19858 commit cbf2c43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/f2fs/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cbf2c43

Please sign in to comment.