diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index bbe07e3a6c75..a6f831ed3d9b 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -1236,6 +1236,8 @@ static int block_operations(struct f2fs_sb_info *sbi) f2fs_do_quota_sync(sbi->sb, -1); up_read(&sbi->sb->s_umount); } + if (unlikely(f2fs_cp_error(sbi))) + return -EIO; cond_resched(); goto retry_flush_quotas; } @@ -1247,6 +1249,8 @@ static int block_operations(struct f2fs_sb_info *sbi) err = f2fs_sync_dirty_inodes(sbi, DIR_INODE, true); if (err) return err; + if (unlikely(f2fs_cp_error(sbi))) + return -EIO; cond_resched(); goto retry_flush_quotas; } @@ -1263,6 +1267,8 @@ static int block_operations(struct f2fs_sb_info *sbi) err = f2fs_sync_inode_meta(sbi); if (err) return err; + if (unlikely(f2fs_cp_error(sbi))) + return -EIO; cond_resched(); goto retry_flush_quotas; } @@ -1280,6 +1286,11 @@ static int block_operations(struct f2fs_sb_info *sbi) f2fs_unlock_all(sbi); return err; } + if (unlikely(f2fs_cp_error(sbi))) { + f2fs_up_write(&sbi->node_change); + f2fs_unlock_all(sbi); + return -EIO; + } cond_resched(); goto retry_flush_nodes; }