From owner-svn-src-all@freebsd.org Wed Mar 8 13:52:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63829D031D6; Wed, 8 Mar 2017 13:52:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CFF01890; Wed, 8 Mar 2017 13:52:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v28Dqj0d071851; Wed, 8 Mar 2017 13:52:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v28Dqjqj071850; Wed, 8 Mar 2017 13:52:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703081352.v28Dqjqj071850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 8 Mar 2017 13:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314913 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Mar 2017 13:52:46 -0000 Author: avg Date: Wed Mar 8 13:52:45 2017 New Revision: 314913 URL: https://svnweb.freebsd.org/changeset/base/314913 Log: MFV r314911: 7867 ARC space accounting leak illumos/illumos-gate@6de76ce2a90f54fecb0dba46dca08c99cef7aa08 https://github.com/illumos/illumos-gate/commit/6de76ce2a90f54fecb0dba46dca08c99cef7aa08 https://www.illumos.org/issues/7867 It seems that in the case where arc_hdr_free_pdata() sees HDR_L2_WRITING() we would fail to update the ARC space statistics. In the normal case those statistics are updated in arc_free_data_buf(). But in the arc_hdr_free_on_write() path we don't do that. Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Approved by: Dan McDonald Author: Andriy Gapon MFC after: 10 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Mar 8 13:48:26 2017 (r314912) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Wed Mar 8 13:52:45 2017 (r314913) @@ -2612,6 +2612,12 @@ arc_hdr_free_on_write(arc_buf_hdr_t *hdr size, hdr); } (void) refcount_remove_many(&state->arcs_size, size, hdr); + if (type == ARC_BUFC_METADATA) { + arc_space_return(size, ARC_SPACE_META); + } else { + ASSERT(type == ARC_BUFC_DATA); + arc_space_return(size, ARC_SPACE_DATA); + } l2arc_free_data_on_write(hdr->b_l1hdr.b_pdata, size, type); }