diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index ca11bbb1500f..ba032eb3e0c5 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2152,6 +2152,9 @@ static void f2fs_enable_checkpoint(struct f2fs_sb_info *sbi) up_write(&sbi->gc_lock); f2fs_sync_fs(sbi->sb, 1); + + /* Let's ensure there's no pending checkpoint anymore */ + f2fs_flush_ckpt_thread(sbi); } static int f2fs_remount(struct super_block *sb, int *flags, char *data) @@ -2318,6 +2321,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) f2fs_stop_ckpt_thread(sbi); need_restart_ckpt = true; } else { + /* Flush if the prevous checkpoint, if exists. */ + f2fs_flush_ckpt_thread(sbi); + err = f2fs_start_ckpt_thread(sbi); if (err) { f2fs_err(sbi,