From owner-svn-src-head@FreeBSD.ORG Fri Nov 21 15:19:35 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50DD4A2F; Fri, 21 Nov 2014 15:19:35 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 00F2AD8F; Fri, 21 Nov 2014 15:19:33 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA06271; Fri, 21 Nov 2014 17:21:24 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Xrpze-0007a1-U1; Fri, 21 Nov 2014 17:19:30 +0200 Message-ID: <546F57B1.2020602@FreeBSD.org> Date: Fri, 21 Nov 2014 17:18:09 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r273060 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201410132039.s9DKdpmh055573@svn.freebsd.org> In-Reply-To: <201410132039.s9DKdpmh055573@svn.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 15:19:35 -0000 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