summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorQu Wenruo2015-05-05 04:53:15 +0200
committerChris Mason2015-06-03 04:34:35 +0200
commit1f6e4b3f9f7c859fed7ac4c0853e976a1a752873 (patch)
treefa34f3f76af7b12888fc285cb044fa495d242432 /fs/btrfs/ctree.h
parentBtrfs: incremental send, fix clone operations for compressed extents (diff)
downloadkernel-qcow2-linux-1f6e4b3f9f7c859fed7ac4c0853e976a1a752873.tar.gz
kernel-qcow2-linux-1f6e4b3f9f7c859fed7ac4c0853e976a1a752873.tar.xz
kernel-qcow2-linux-1f6e4b3f9f7c859fed7ac4c0853e976a1a752873.zip
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>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h2
1 files changed, 1 insertions, 1 deletions
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