btrfs-progs: check: Remove the ability to rebuild root overwriting existing tree...
commit5f594c3ce3cd5158d16f80db576ae84d69bc0636
authorQu Wenruo <wqu@suse.com>
Thu, 5 Jul 2018 07:37:28 +0000 (5 15:37 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 13:04:58 +0000 (6 15:04 +0200)
tree882fd12f259a05351591dbd2d6393c6789deaa40
parenta4770b0a013e5934461d05f256dd90266c4cf0c5
btrfs-progs: check: Remove the ability to rebuild root overwriting existing tree blocks

We have function btrfs_fsck_reinit_root() to reinit csum or extent tree.
However this function allows us to let it overwrite existing tree blocks
using @overwrite parameter.

Such behavior is pretty dangerous while no caller is using this feature
explicitly.

So just remove @overwrite parameter and allow btrfs_fsck_reinit_root()
to error out when it fails to allocate tree block.

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