Skip to content

Commit

Permalink
f2fs: fix flushing node pages when checkpoint is disabled
Browse files Browse the repository at this point in the history
This patch fixes skipping node page writes when checkpoint is disabled.
In this period, we can't rely on checkpoint to flush node pages.

Fixes: fd8c8ca ("f2fs: let checkpoint flush dnode page of regular")
Fixes: 4354994 ("f2fs: checkpoint disabling")
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Jaegeuk Kim committed Sep 6, 2019
1 parent 00e09c0 commit 100c065
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/f2fs/node.c
Original file line number Diff line number Diff line change
@@ -1524,7 +1524,8 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
goto redirty_out;

if (wbc->sync_mode == WB_SYNC_NONE &&
if (!is_sbi_flag_set(sbi, SBI_CP_DISABLED) &&
wbc->sync_mode == WB_SYNC_NONE &&
IS_DNODE(page) && is_cold_node(page))
goto redirty_out;

@@ -1909,7 +1910,8 @@ int f2fs_sync_node_pages(struct f2fs_sb_info *sbi,
}

if (step < 2) {
if (wbc->sync_mode == WB_SYNC_NONE && step == 1)
if (!is_sbi_flag_set(sbi, SBI_CP_DISABLED) &&
wbc->sync_mode == WB_SYNC_NONE && step == 1)
goto out;
step++;
goto next_step;

0 comments on commit 100c065

Please sign in to comment.