Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2018 22:43:55 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r331708 - vendor-sys/illumos/dist/uts/common/fs/zfs
Message-ID:  <201803282243.w2SMhtES051020@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Mar 28 22:43:55 2018
New Revision: 331708
URL: https://svnweb.freebsd.org/changeset/base/331708

Log:
  9321 arc_loan_compressed_buf() can increment arc_loaned_bytes by the wrong value
  
  illumos/illumos-gate@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@delphix.com>
  Reviewed by: George Wilson <george.wilson@delphix.com>
  Approved by: Garrett D'Amore <garrett@damore.org>
  Author: Allan Jude <allanjude@freebsd.org>

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c
==============================================================================
--- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c	Wed Mar 28 22:29:06 2018	(r331707)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c	Wed Mar 28 22:43:55 2018	(r331708)
@@ -2557,7 +2557,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);
 }
@@ -2569,7 +2569,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);
 }



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