diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-08-20 00:52:02 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-09-13 08:07:12 +0200 |
commit | c7b58576370147833999fd4cc874d0f918bdf9ca (patch) | |
tree | f7202bfbb28fd6ba52babb4361fac7fa7db910eb /fs/f2fs/super.c | |
parent | f2fs: remove gc_urgent_high_limited for cleanup (diff) | |
download | linux-c7b58576370147833999fd4cc874d0f918bdf9ca.tar.xz linux-c7b58576370147833999fd4cc874d0f918bdf9ca.zip |
f2fs: flush pending checkpoints when freezing super
This avoids -EINVAL when trying to freeze f2fs.
Cc: stable@vger.kernel.org
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | fs/f2fs/super.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index e910f0e39d76..4f2ff50b247c 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1671,9 +1671,8 @@ static int f2fs_freeze(struct super_block *sb) if (is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY)) return -EINVAL; - /* ensure no checkpoint required */ - if (!llist_empty(&F2FS_SB(sb)->cprc_info.issue_list)) - return -EINVAL; + /* Let's flush checkpoints and stop the thread. */ + f2fs_flush_ckpt_thread(F2FS_SB(sb)); /* to avoid deadlock on f2fs_evict_inode->SB_FREEZE_FS */ set_sbi_flag(F2FS_SB(sb), SBI_IS_FREEZING); |