]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: add cp_error check in f2fs_write_compressed_pages
authorChao Yu <yuchao0@huawei.com>
Tue, 27 Apr 2021 03:07:30 +0000 (11:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:32:18 +0000 (13:32 +0200)
[ Upstream commit ee68d27181f060fab29e60d1d31aab6a42703dd4 ]

This patch adds cp_error check in f2fs_write_compressed_pages() like we did
in f2fs_write_single_data_page()

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Stable-dep-of: 278a6253a673 ("f2fs: fix to relocate check condition in f2fs_fallocate()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/compress.c

index be6f2988ac7fc7eb30d232970c6fed8b3d164cda..9dc2e09f0a60d7630ae2199675ebddd4f7bb0292 100644 (file)
@@ -1161,6 +1161,12 @@ static int f2fs_write_compressed_pages(struct compress_ctx *cc,
        loff_t psize;
        int i, err;
 
+       /* we should bypass data pages to proceed the kworkder jobs */
+       if (unlikely(f2fs_cp_error(sbi))) {
+               mapping_set_error(cc->rpages[0]->mapping, -EIO);
+               goto out_free;
+       }
+
        if (IS_NOQUOTA(inode)) {
                /*
                 * We need to wait for node_write to avoid block allocation during