From 25b93eefe29cdfb1d799498dfc69f122ac3e247e Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 4 Apr 2016 13:15:46 +0200 Subject: [PATCH] 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 --- cmds-check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index 85f475b7..de17be35 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -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;