svn commit: r332551 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Alexander Motin mav at FreeBSD.org
Mon Apr 16 04:14:42 UTC 2018


Author: mav
Date: Mon Apr 16 04:14:42 2018
New Revision: 332551
URL: https://svnweb.freebsd.org/changeset/base/332551

Log:
  MFC r331709: MFV r331708:
  9321 arc_loan_compressed_buf() can increment arc_loaned_bytes by the wrong value
  
  illumos/illumos-gate at 9be12bd737714550277bd02b0c693db560976990
  
  arc_loan_compressed_buf() increments arc_loaned_bytes by psize unconditionally
  In the case of zfs_compressed_arc_enabled=0, when the buf is returned via
  arc_return_buf(), if ARC_BUF_COMPRESSED(buf) is false, then arc_loaned_bytes
  is decremented by lsize, not psize.
  
  Switch to using arc_buf_size(buf), instead of psize, which will return
  psize or lsize, depending on the result of ARC_BUF_COMPRESSED(buf).
  
  Reviewed by: Matt Ahrens <matt at delphix.com>
  Reviewed by: George Wilson <george.wilson at delphix.com>
  Approved by: Garrett D'Amore <garrett at damore.org>
  Author: Allan Jude <allanjude at freebsd.org>

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Mon Apr 16 04:14:03 2018	(r332550)
+++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Mon Apr 16 04:14:42 2018	(r332551)
@@ -2877,7 +2877,7 @@ arc_loan_buf(spa_t *spa, boolean_t is_metadata, int si
 	arc_buf_t *buf = arc_alloc_buf(spa, arc_onloan_tag,
 	    is_metadata ? ARC_BUFC_METADATA : ARC_BUFC_DATA, size);
 
-	arc_loaned_bytes_update(size);
+	arc_loaned_bytes_update(arc_buf_size(buf));
 
 	return (buf);
 }
@@ -2889,7 +2889,7 @@ arc_loan_compressed_buf(spa_t *spa, uint64_t psize, ui
 	arc_buf_t *buf = arc_alloc_compressed_buf(spa, arc_onloan_tag,
 	    psize, lsize, compression_type);
 
-	arc_loaned_bytes_update(psize);
+	arc_loaned_bytes_update(arc_buf_size(buf));
 
 	return (buf);
 }


More information about the svn-src-all mailing list