Skip to content

Commit 323d6b4

Browse files
Jaegeuk Kimpundiramit
authored andcommitted
f2fs: call sync_fs when f2fs is idle
commit f455c8a5f0a24090e99249eb7280012376adec2c upstream. The sync_fs in f2fs_balance_fs_bg must avoid interrupting current user requests. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 9d8116e commit 323d6b4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/f2fs/segment.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,15 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi)
381381
else
382382
build_free_nids(sbi, false);
383383

384+
if (!is_idle(sbi))
385+
return;
386+
384387
/* checkpoint is the only way to shrink partial cached entries */
385388
if (!available_free_memory(sbi, NAT_ENTRIES) ||
386389
!available_free_memory(sbi, INO_ENTRIES) ||
387390
excess_prefree_segs(sbi) ||
388391
excess_dirty_nats(sbi) ||
389-
(is_idle(sbi) && f2fs_time_over(sbi, CP_TIME))) {
392+
f2fs_time_over(sbi, CP_TIME)) {
390393
if (test_opt(sbi, DATA_FLUSH)) {
391394
struct blk_plug plug;
392395

0 commit comments

Comments
 (0)