btrfs-progs: check: add support to clear v1 free space cache
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Thu, 13 Oct 2016 09:22:26 +0000 (17:22 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 9 Nov 2016 12:12:47 +0000 (13:12 +0100)
commiteb8a61b235ad035cc474bef78e10453ec3d11d72
treeec41a685063f7a315e728abeeef31afd4031d110
parent08d31c1c7ca5a6bb4e6485fa118c552c938e9efb
btrfs-progs: check: add support to clear v1 free space cache

Kernel clear_cache mount option will only rebuild free space cache if
the used space of that chunk has changed.

So it won't ensure any corrupted free space cache get cleared.

So add a new option "--clear-space-cache v1|v2" to btrfsck, to
completely wipe out free space cache.
So kernel won't complain again.

Reported-by: Ivan P <chrnosphered@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ adjusted error messages, doc wording changes ]
Signed-off-by: David Sterba <dsterba@suse.com>
Documentation/btrfs-check.asciidoc
cmds-check.c
free-space-cache.c
free-space-cache.h