svn commit: r273060 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Fri Nov 21 15:19:35 UTC 2014


On 13/10/2014 23:39, Xin LI wrote:
> Author: delphij
> Date: Mon Oct 13 20:39:51 2014
> New Revision: 273060
> URL: https://svnweb.freebsd.org/changeset/base/273060
> 
> Log:
>   Use write_psize instead of write_asize when doing vdev_space_update.
>   Without this change the accounting of L2ARC usage would be wrong and
>   give 16EB free space because the number became negative and overflows.
>   
>   Obtained from:	FreeNAS (issue #6239)

First, a link to the issue would be more convenient for reviewers.  Here it is
https://bugs.freenas.org/issues/6239

Then, I would like to see a technical explanation for this change.
I could not find any explanation here or in the FreeNAS issue or in the FreeNAS
commit.

As far as I can see, all calls to vdev_space_update() in the ARC code are passed
l2hdr->b_asize or a sum of b_asize fields of multiple buffers.
Thus, I am really surprised with this change and would like to see reasoning
behind it.


>   MFC after:	2 weeks
> 
> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
> 
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
> ==============================================================================
> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Mon Oct 13 19:05:18 2014	(r273059)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Mon Oct 13 20:39:51 2014	(r273060)
> @@ -5232,7 +5232,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_de
>  	ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize);
>  	ARCSTAT_INCR(arcstat_l2_size, write_sz);
>  	ARCSTAT_INCR(arcstat_l2_asize, write_asize);
> -	vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0);
> +	vdev_space_update(dev->l2ad_vdev, write_psize, 0, 0);
>  
>  	/*
>  	 * Bump device hand to the device start if it is approaching the end.
> 


-- 
Andriy Gapon


More information about the svn-src-all mailing list