btrfs: add more superblock checks
authorDavid Sterba <dsterba@suse.cz>
Tue, 30 Sep 2014 17:16:47 +0000 (19:16 +0200)
committerChris Mason <clm@fb.com>
Fri, 3 Oct 2014 23:14:59 +0000 (16:14 -0700)
commitc926093ec516f5d316ecdf8c1be11f577ac71b85
tree80cea5b9e2d7264940ae53a5ab2808a34dc107f9
parent42383020beb1cfb05f5d330cc311931bc4917a97
btrfs: add more superblock checks

Populate btrfs_check_super_valid() with checks that try to verify
consistency of superblock by additional conditions that may arise from
corrupted devices or bitflips. Some of tests are only hints and issue
warnings instead of failing the mount, basically when the checks are
derived from the data found in the superblock.

Tested on a broken image provided by Qu.

Reported-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/disk-io.c