btrfs-progs/convert
Jeff Mahoney f2c14eb282 btrfs-progs: convert: use search_cache_extent in migrate_one_reserved_range
When we are looking for extents in migrate_one_reserved_range, it's likely
that there will be multiple extents that fall into the 0-1MB range.

If lookup_cache_extent is called with a range that covers multiple cache
entries, it will return the first entry it encounters while searching
from the top of the tree that happens to fall in that range.  That
means that we can end up skipping regions within that range, resulting
in a file system image that can't be rolled back since it wasn't
all migrated properly.

This is reproducible using convert-tests/008-readonly-image.  There was
a range from 0-160kB, but the only entry that was returned began at
~ 280kB.

The fix is to use search_cache_extent to iterate through multiple regions
within that range.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-08-24 19:07:29 +02:00
..
Makefile btrfs-progs: build: add stub makefile to convert 2017-03-08 13:00:46 +01:00
common.c btrfs-progs: Remove deprecated leafsize usage 2017-07-03 13:35:10 +02:00
common.h btrfs-progs: convert: widen int types in convert context 2017-06-26 17:09:53 +02:00
main.c btrfs-progs: convert: use search_cache_extent in migrate_one_reserved_range 2017-08-24 19:07:29 +02:00
source-ext2.c btrfs-progs: convert: Fix data race when reporting progress 2017-07-20 17:43:43 +02:00
source-ext2.h btrfs-progs: convert: move ext2 definitions out of main 2017-03-08 13:00:45 +01:00
source-fs.c btrfs-progs: convert: properly handle reserved ranges while iterating files 2017-08-24 19:07:18 +02:00
source-fs.h btrfs-progs: convert: Fix data race when reporting progress 2017-07-20 17:43:43 +02:00