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

Andriy Gapon avg at FreeBSD.org
Wed Mar 8 13:52:46 UTC 2017


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 at 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 at delphix.com>
  Reviewed by: Dan Kimmel <dan.kimmel at delphix.com>
  Approved by: Dan McDonald <danmcd at omniti.com>
  Author: Andriy Gapon <avg at 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);
 }


More information about the svn-src-head mailing list