aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu2020-12-09 02:42:14 -0600
committerJaegeuk Kim2020-12-21 15:33:20 -0600
commit3ed3a9407a87a22947ccea4ab7e65c9826cafd22 (patch)
treefc03bd9a2936e57032fc7aa1e2cda61a87389dcf
parentde3e65bbe388d19bd3b18cb8379f24ada06918d5 (diff)
downloadkernel-3ed3a9407a87a22947ccea4ab7e65c9826cafd22.tar.gz
kernel-3ed3a9407a87a22947ccea4ab7e65c9826cafd22.tar.xz
kernel-3ed3a9407a87a22947ccea4ab7e65c9826cafd22.zip
f2fs: compress: fix compression chksum
This patch addresses minor issues in compression chksum. Fixes: b28f047b28c5 ("f2fs: compress: support chksum") Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/compress.c3
-rw-r--r--fs/f2fs/compress.h0
2 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index f05d409fd0ed..4bcbacfe3325 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -796,7 +796,7 @@ void f2fs_decompress_pages(struct bio *bio, struct page *page, bool verity)
796 796
797 ret = cops->decompress_pages(dic); 797 ret = cops->decompress_pages(dic);
798 798
799 if (!ret && fi->i_compress_flag & 1 << COMPRESS_CHKSUM) { 799 if (!ret && (fi->i_compress_flag & 1 << COMPRESS_CHKSUM)) {
800 u32 provided = le32_to_cpu(dic->cbuf->chksum); 800 u32 provided = le32_to_cpu(dic->cbuf->chksum);
801 u32 calculated = f2fs_crc32(sbi, dic->cbuf->cdata, dic->clen); 801 u32 calculated = f2fs_crc32(sbi, dic->cbuf->cdata, dic->clen);
802 802
@@ -809,7 +809,6 @@ void f2fs_decompress_pages(struct bio *bio, struct page *page, bool verity)
809 provided, calculated); 809 provided, calculated);
810 } 810 }
811 set_sbi_flag(sbi, SBI_NEED_FSCK); 811 set_sbi_flag(sbi, SBI_NEED_FSCK);
812 WARN_ON_ONCE(1);
813 } 812 }
814 } 813 }
815 814
diff --git a/fs/f2fs/compress.h b/fs/f2fs/compress.h
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/fs/f2fs/compress.h