Btrfs-progs: fix btrfs-convert rollback to check ROOT_BACKREF
authorLiu Bo <bo.li.liu@oracle.com>
Sun, 18 Oct 2015 05:44:41 +0000 (13:44 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 2 Nov 2015 08:35:06 +0000 (09:35 +0100)
commita1126f3673f60814609491d16c863a3a91ec078f
treea9286c2756733feb0c5ee73ab42ba4a369b74541
parent30b72caa2e640bcfa15535f3d28385149c63939f
Btrfs-progs: fix btrfs-convert rollback to check ROOT_BACKREF

Btrfs has changed to delete subvolume/snapshot asynchronously, which
means that after umount itself, if we've already deleted 'ext2_saved',
rollback can still be completed.

So this adds a check for ROOT_BACKREF before checking ROOT_ITEM since
ROOT_BACKREF is immediately not in the btree after
ioctl(BTRFS_IOC_SNAP_DESTROY) returns.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ updated error messages ]
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-convert.c