]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
f2fs: fix to handle error in f2fs_disable_checkpoint()
authorChao Yu <yuchao0@huawei.com>
Fri, 26 Apr 2019 09:57:54 +0000 (17:57 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 9 May 2019 04:23:13 +0000 (21:23 -0700)
In f2fs_disable_checkpoint(), it needs to detect and propagate error
number returned from f2fs_write_checkpoint().

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/super.c

index 4f8e9ab48b26a93eb48c265d3ac3e1368d09640f..fe075aa12893b7a37b3118d0d5f5354a36c5d4ea 100644 (file)
@@ -1504,9 +1504,12 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi)
        mutex_lock(&sbi->gc_mutex);
        cpc.reason = CP_PAUSE;
        set_sbi_flag(sbi, SBI_CP_DISABLED);
-       f2fs_write_checkpoint(sbi, &cpc);
+       err = f2fs_write_checkpoint(sbi, &cpc);
+       if (err)
+               goto out_unlock;
 
        sbi->unusable_block_count = 0;
+out_unlock:
        mutex_unlock(&sbi->gc_mutex);
 restore_flag:
        sbi->sb->s_flags = s_flags;     /* Restore MS_RDONLY status */