From 10fe6ca80d9d25eca9fd6d98eccf6c795532fe96 Mon Sep 17 00:00:00 2001 From: Johannes Thumshirn Date: Wed, 22 May 2019 10:19:02 +0200 Subject: btrfs: don't assume compressed_bio sums to be 4 bytes BTRFS has the implicit assumption that a checksum in compressed_bio is 4 bytes. While this is true for CRC32C, it is not for any other checksum. Change the data type to be a byte array and adjust loop index calculation accordingly. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/compression.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/btrfs/compression.h') diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h index 9976fe0f7526..191e5f4e3523 100644 --- a/fs/btrfs/compression.h +++ b/fs/btrfs/compression.h @@ -61,7 +61,7 @@ struct compressed_bio { * the start of a variable length array of checksums only * used by reads */ - u32 sums; + u8 sums[]; }; static inline unsigned int btrfs_compress_type(unsigned int type_level) -- cgit v1.2.3-59-g8ed1b