btrfs-progs: check/original: Avoid infinite loop when failed to repair inode
commit159f177cf93a235762dd9e776752cdfbda0dbb8c
authorQu Wenruo <wqu@suse.com>
Thu, 5 Jul 2018 07:37:30 +0000 (5 15:37 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 13:06:20 +0000 (6 15:06 +0200)
tree0722f2744a2d9e9bce5857b573e6eb1e36dbcb0a
parent5f594c3ce3cd5158d16f80db576ae84d69bc0636
btrfs-progs: check/original: Avoid infinite loop when failed to repair inode

Exposed by fuzz-tests/003-multi-check-unmounted/ on fuzzed image
bko-161811.raw.xz.

It's caused by the fact when check_fs_roots() finds tree root is
modified, it re-search tree root by goto again: label.
However again: label. will also reset root objectid to 0.
If we failed to repair one fs root but still modified tree root, we will
go into such infinite loop.

Fix it by recording which root we should skip for repair mode.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
check/main.c