Commit 1f6e4b3f authored by Qu Wenruo's avatar Qu Wenruo Committed by Chris Mason

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: default avatarLukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: default avatarQu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 619d8c4e
...@@ -174,7 +174,7 @@ struct btrfs_ordered_sum; ...@@ -174,7 +174,7 @@ struct btrfs_ordered_sum;
/* csum types */ /* csum types */
#define BTRFS_CSUM_TYPE_CRC32 0 #define BTRFS_CSUM_TYPE_CRC32 0
static int btrfs_csum_sizes[] = { 4, 0 }; static int btrfs_csum_sizes[] = { 4 };
/* four bytes for CRC32 */ /* four bytes for CRC32 */
#define BTRFS_EMPTY_DIR_SIZE 0 #define BTRFS_EMPTY_DIR_SIZE 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment