Date: Mon, 16 Apr 2018 04:14:42 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332551 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201804160414.w3G4Egjh031530@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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: 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804160414.w3G4Egjh031530>