btrfs-progs: handle blockgroup errors when opening filesystem
commit9b47f18aec5afb87e2271acc2c39cdc698658f7d
authorDavid Sterba <dsterba@suse.com>
Fri, 25 Aug 2017 17:08:37 +0000 (25 19:08 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 8 Sep 2017 14:15:05 +0000 (8 16:15 +0200)
treeedca4228f005054f23030458cff59f2c3fa0fa68
parent145a5969bd5c8a276128b54217d0a6459c8a3af8
btrfs-progs: handle blockgroup errors when opening filesystem

The call to btrfs_read_block_groups could loop if the metadata are
damaged (reported eg. for an unaligned block), due to lack of error
handling. We have to check for restored images or currently created
filesystems, that do not contain the blockgroups.

Can be reproduced by fuzzed image bko-155551.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=155551
Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
disk-io.c