btrfs: enhance superblock checks
[linux-2.6-block.git] / fs / btrfs / ctree.h
index 78b9d457d72301c41977bcb7718478219de07a9a..63c328a9ce956c716c8ed6e1a0131b5260bb022b 100644 (file)
@@ -2793,8 +2793,10 @@ BTRFS_SETGET_STACK_FUNCS(super_cache_generation, struct btrfs_super_block,
 
 static inline int btrfs_super_csum_size(struct btrfs_super_block *s)
 {
-       int t = btrfs_super_csum_type(s);
-       BUG_ON(t >= ARRAY_SIZE(btrfs_csum_sizes));
+       u16 t = btrfs_super_csum_type(s);
+       /*
+        * csum type is validated at mount time
+        */
        return btrfs_csum_sizes[t];
 }