btrfs-progs: check: Also check and repair unaligned/mismatch device and super sizes
authorQu Wenruo <wqu@suse.com>
Tue, 10 Oct 2017 05:53:24 +0000 (13:53 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Nov 2017 14:59:00 +0000 (15:59 +0100)
commita1a6da60670fc4418be1126be5843596b434b6df
tree6484814c0fedcf10ca9396fa51fd7efd55f2e9c5
parent06f56db9cb1aaff277b25f07da091e146ac319b9
btrfs-progs: check: Also check and repair unaligned/mismatch device and super sizes

Along with the rescue introduced, also introduce check and repair for them.

Unlike normal check functions, some of the check is optional, and even if
the image failed to pass optional check, kernel can still runs fine.
(But may cause noisy kernel warning)

So some check, mainly for alignment, will not cause btrfs check to fail,
but only to output warning and instructs how to fix it.

For repair, it just calls the same repair function in rescue, and is
included in 'btrfs check --repair'.
But 'btrfs rescue' is still the preferred method, since it can be used
independent of all the 'check' passes, if we know what's the exact
problem to fix.

Signed-off-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c