Re: [PATCH] btrfs-progs: fsck: Fix found bytes accounting error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 26, 2016 at 10:49:49AM +0800, Qu Wenruo wrote:
> 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.

I'm not able to trace that back to the original code, the value template
is just filled from the parameters and I don't see where bytes_used
would get set from the rec->nr value.

> --- 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;

ie. this would be just 'nr' before the refactoring.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux