btrfs-progs: btrfstune: fix a bug which makes unfinished fsid change unrecoverable
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 15 May 2015 06:36:35 +0000 (14:36 +0800)
committerDavid Sterba <dsterba@suse.cz>
Tue, 26 May 2015 15:25:10 +0000 (17:25 +0200)
commitab747f84cad2047dcc7eb2850f4c9251437eb50b
treed47b28ee4da946f8af46bd3e739f29e2ca528aa3
parent99ad3805beed9f527830c2d07118718872224e9f
btrfs-progs: btrfstune: fix a bug which makes unfinished fsid change unrecoverable

This bug is found by making break point after change_fsid_prepare() and
then kill the unfinished change, then try to restore the unfinished fsid
change.

If fsid change is canceled, open_ctree will still fail even with
IGNORE_FSID_MIMATCH open ctree flag, since it can't find device with
mismatched fsid, making it unable to restoring.

Now add ignore_fsid_mismatch judgment in btrfs_find_device() to fix the
bug and allow later restore to work as expected.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
volumes.c