Btrfs-progs: fsck: deal with corrupted csum root
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Thu, 29 May 2014 09:59:57 +0000 (17:59 +0800)
committerDavid Sterba <dsterba@suse.cz>
Fri, 10 Oct 2014 16:11:32 +0000 (18:11 +0200)
commited1b086a3042c25655233ece41ff97b8ecc73a35
tree9b84dbe23db01bdb533b23014acd4a9ac63268dc
parent8d2abcb6cc50762536fe04c50bf262f1ccf3b9a3
Btrfs-progs: fsck: deal with corrupted csum root

If checksum root is corrupted, fsck will get segmentation. This
is because if we fail to load checksum root, root's node is NULL which
cause NULL pointer deferences later.

To fix this problem, we just did something like extent tree rebuilding.
Allocate a new one and clear uptodate flag. We will do sanity check
before fsck going on.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-check.c
disk-io.c