btrfs-progs: convert: Fix bugs in backup superblock migration
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 31 May 2016 08:49:33 +0000 (16:49 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Jun 2016 16:15:19 +0000 (18:15 +0200)
commit0c621b519d531600655f179f1ebf62c0dd95e478
treeacccfb3e21053477209de860838d5e72cd8dcc4c
parente37ea89b521ccab01c1ff9f9777ea3eaad1c1913
btrfs-progs: convert: Fix bugs in backup superblock migration

New convert has several bugs with backup superblock migration

1) Backup superblocks are not migrated due to incorrect condition
   Two wrong checks cause backup superblocks not to be migrated at all

2) Converted ext* image doesn't keep hole for backup superblocks
   Since we are creating file extents according to tmp_used, which has
   wiped out backup superblock ranges.
   In that case, later superblock migration will fail, since migration
   will insert file extent range into ext* image.

Fix above bugs will make convert on ext2 image filled about 100M data
successful.

Reported-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-convert.c