From: Qu Wenruo Date: Tue, 5 May 2015 02:53:15 +0000 (+0800) Subject: btrfs: Fix superblock csum type check. X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1f6e4b3f9f7c859fed7ac4c0853e976a1a752873;p=openwrt%2Fstaging%2Fblogic.git btrfs: Fix superblock csum type check. Old csum type check is wrong and can't catch csum_type 1(not supported). Fix it to avoid hostile 0 division. Reported-by: Lukas Lueg Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 670e4be7225b..9d7a6c38f0b1 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -174,7 +174,7 @@ struct btrfs_ordered_sum; /* csum types */ #define BTRFS_CSUM_TYPE_CRC32 0 -static int btrfs_csum_sizes[] = { 4, 0 }; +static int btrfs_csum_sizes[] = { 4 }; /* four bytes for CRC32 */ #define BTRFS_EMPTY_DIR_SIZE 0