btrfs-progs: convert: Fix a bug in rollback check which overwrite return value
authorQu Wenruo <wqu@suse.com>
Wed, 29 Nov 2017 13:48:05 +0000 (21:48 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 3 Jan 2018 16:29:19 +0000 (17:29 +0100)
commite8f9653fc04513db59b0d1438367ecee1552db9d
tree216a0d67562b09fe7040ff3a7b74f4d1b2b77275
parent0a9ab8725293cc93a86cc55859ac2378df5c4212
btrfs-progs: convert: Fix a bug in rollback check which overwrite return value

Commit 1170ac307900 ("btrfs-progs: convert: Introduce function to check if
convert image is able to be rolled back") reworked rollback check
condition, by checking 1:1 mapping of each file extent.

The idea itself has nothing wrong, but error handler is not implemented
correctly, which over writes the return value and always try to rollback
the fs even it fails to pass the check.

Fix it by correctly return the error before rollback the fs.

Fixes: 1170ac307900 ("btrfs-progs: convert: Introduce function to check if convert image is able to be rolled back")
Reported-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
convert/main.c