Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Mar 2017 13:52:45 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
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
Message-ID:  <201703081352.v28Dqjqj071850@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <mahrens@delphix.com>
  Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
  Approved by: Dan McDonald <danmcd@omniti.com>
  Author: Andriy Gapon <avg@FreeBSD.org>
  
  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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703081352.v28Dqjqj071850>