btrfs-progs: check: make max_size consistent with nr

Since we memset tmpl, max_size==0. This does not seem consistent with nr = 1.
In check_extent_refs, we will call:

  set_extent_dirty(root->fs_info->excluded_extents,
                   rec->start,
                   rec->start + rec->max_size - 1);

This ends up with BUG_ON(end < start) in insert_state.

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Christophe de Dinechin 2017-04-28 11:51:21 +02:00 committed by David Sterba
parent 05011bf0d4
commit 091a1138bd

View File

@ -6194,6 +6194,7 @@ static int add_tree_backref(struct cache_tree *extent_cache, u64 bytenr,
tmpl.start = bytenr;
tmpl.nr = 1;
tmpl.metadata = 1;
tmpl.max_size = 1;
ret = add_extent_rec_nolookup(extent_cache, &tmpl);
if (ret)