f2fs: fix flushing node pages when checkpoint is disabled
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 29 Aug 2019 02:58:26 +0000 (19:58 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 6 Sep 2019 23:18:26 +0000 (16:18 -0700)
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: fd8c8caf7e7c ("f2fs: let checkpoint flush dnode page of regular")
Fixes: 4354994f097d ("f2fs: checkpoint disabling")
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c

index e5044ee..8b66bc4 100644 (file)
@@ -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 @@ continue_unlock:
        }
 
        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;