Skip to content

Commit cd6d697

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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: 493720a ("f2fs: fix to avoid REQ_TIME and CP_TIME collision") Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 011e086 commit cd6d697

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/f2fs/segment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg)
580580
goto do_sync;
581581

582582
/* checkpoint is the only way to shrink partial cached entries */
583-
if (f2fs_available_free_memory(sbi, NAT_ENTRIES) ||
583+
if (f2fs_available_free_memory(sbi, NAT_ENTRIES) &&
584584
f2fs_available_free_memory(sbi, INO_ENTRIES))
585585
return;
586586

0 commit comments

Comments
 (0)