diff options
author | mav <mav@FreeBSD.org> | 2015-11-13 09:17:48 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-11-13 09:17:48 +0000 |
commit | e7bc2aced507b7e942a58282c9aab5543d0b3d04 (patch) | |
tree | 37c7f6caeefb43312b13dc3c69686736ae74d32f /sys/cddl | |
parent | d0ddc5d9b2c6bdf2671ce69bfdf788d45d7cb234 (diff) | |
download | FreeBSD-src-e7bc2aced507b7e942a58282c9aab5543d0b3d04.zip FreeBSD-src-e7bc2aced507b7e942a58282c9aab5543d0b3d04.tar.gz |
MFC r289295: 5219 l2arc_write_buffers() may write beyond target_sz
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Saso Kiselkov <skiselkov@gmail.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Steven Hartland <steven.hartland@multiplay.co.uk>
Reviewed by: Justin Gibbs <gibbs@FreeBSD.org>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Andriy Gapon <avg@freebsd.org>
illumos/illumos-gate@d7d9a6d919f92d74ea0510a53f8441396048e800
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index b053993..c502296 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -6246,7 +6246,8 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz, boolean_t *headroom_boost) { arc_buf_hdr_t *hdr, *hdr_prev, *head; - uint64_t write_asize, write_sz, headroom, buf_compress_minsz; + uint64_t write_asize, write_sz, headroom, + buf_compress_minsz; void *buf_data; boolean_t full; l2arc_write_callback_t *cb; @@ -6408,6 +6409,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz, * using it to denote the header's state change. */ hdr->b_l2hdr.b_daddr = L2ARC_ADDR_UNSET; + hdr->b_flags |= ARC_FLAG_HAS_L2HDR; mutex_enter(&dev->l2ad_mtx); |