From: Chao Yu Date: Tue, 27 Apr 2021 03:07:30 +0000 (+0800) Subject: f2fs: add cp_error check in f2fs_write_compressed_pages X-Git-Tag: v5.14-rc1~39^2~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee68d27181f060fab29e60d1d31aab6a42703dd4;p=thirdparty%2Fkernel%2Flinux.git f2fs: add cp_error check in f2fs_write_compressed_pages 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 Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 19097a1d0125e..ac321e217d574 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1216,6 +1216,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