btrfs-progs: check: check stripe crossing against nodesize

The extent record's max_size might be 0 and the stripe crossing check
will report a false positive, should use the filesyste nodesize. There's
a global fs_info available.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-04-04 13:15:46 +02:00
parent b241a46c7c
commit 25b93eefe2

View file

@ -4554,7 +4554,7 @@ static int add_extent_rec_nolookup(struct cache_tree *extent_cache,
if (tmpl->metadata)
rec->crossing_stripes = check_crossing_stripes(rec->start,
rec->max_size);
global_info->tree_root->nodesize);
check_extent_type(rec);
return ret;
}
@ -4655,7 +4655,7 @@ static int add_extent_rec(struct cache_tree *extent_cache,
*/
if (tmpl->metadata)
rec->crossing_stripes = check_crossing_stripes(
rec->start, rec->max_size);
rec->start, global_info->tree_root->nodesize);
check_extent_type(rec);
maybe_free_extent_rec(extent_cache, rec);
return ret;