btrfs-progs: convert: Fix a bug that makes convert asserts at scan time
commite37ea89b521ccab01c1ff9f9777ea3eaad1c1913
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 31 May 2016 07:51:13 +0000 (31 15:51 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Jun 2016 16:15:19 +0000 (7 18:15 +0200)
tree49f114977caef4cfa09dc079cefd7faaa217857b
parent9c4b820412746b32d400333d7e4337a3ee710701
btrfs-progs: convert: Fix a bug that makes convert asserts at scan time

When a ext2 fs filled with a 57M file, it's possible that convert fails
with assert in add_merge_cache_extent().

The problem is that the ext2 used space just takes some of the second
superblock.
And due to a bug in reserving superblock space, it corrupted used space
tree and cause assert.

Fix in by doing better used space merging for case where superblock
range is inside the ext2 used space.

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