btrfs-progs: check: fix found bytes accounting error

In the new add_extent_rec_nolookup() function, we add bytes_used to
update found bytes accounting.

However there is a typo that we used tmpl->nr, which should be rec->nr.
This will make us to add 1 for data backref, instead the correct size.

Reported-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Qu Wenruo 2016-04-26 10:49:49 +08:00 committed by David Sterba
parent 25b93eefe2
commit e6de81e959
1 changed files with 1 additions and 1 deletions

View File

@ -4550,7 +4550,7 @@ static int add_extent_rec_nolookup(struct cache_tree *extent_cache,
rec->cache.size = tmpl->nr;
ret = insert_cache_extent(extent_cache, &rec->cache);
BUG_ON(ret);
bytes_used += tmpl->nr;
bytes_used += rec->nr;
if (tmpl->metadata)
rec->crossing_stripes = check_crossing_stripes(rec->start,