btrfs-progs: check: fix extents after finding all errors
authorGoldwyn Rodrigues <rgoldwyn@suse.com>
Thu, 1 Dec 2016 17:28:08 +0000 (11:28 -0600)
committerDavid Sterba <dsterba@suse.com>
Wed, 14 Dec 2016 14:06:35 +0000 (15:06 +0100)
commit617af9e92e0c4cb6c15c5f3d5d9cb194c303c4b6
tree51baea65f4cba8b3bf4752ebe9051db856259d06
parent0a074116fc9c0c52266a6fff31d7eecc59d30604
btrfs-progs: check: fix extents after finding all errors

Simplifying the logic of fixing.

Calling fixup_extent_ref() after encountering every error causes
more error messages after the extent is fixed. In case of multiple errors,
this is confusing because the error message is displayed after the fix
message and it works on stale data. It is best to show all errors and
then fix the extents.

Set a variable and call fixup_extent_ref() if it is set. err is not used,
so cleared it.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c