mirror of https://gitee.com/openkylin/linux.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 <lukas.lueg@gmail.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
619d8c4ef7
commit
1f6e4b3f9f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue