From: Qu Wenruo Date: Tue, 26 Apr 2016 02:49:49 +0000 (+0800) Subject: btrfs-progs: check: fix found bytes accounting error X-Git-Tag: upstream/4.16.1~1596 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6de81e95934a530cda65b546eb3fcfeaaa262e9;p=platform%2Fupstream%2Fbtrfs-progs.git 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 Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- diff --git a/cmds-check.c b/cmds-check.c index de17be3..bada87e 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -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,