From 919a4965a503f103b2cee012040494cc815d31d2 Mon Sep 17 00:00:00 2001 From: Igor Kozhukhov Date: Sat, 11 May 2019 16:06:19 +0300 Subject: [PATCH] fix panic on debug build Signed-off-by: Igor Kozhukhov --- module/zfs/arc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 9b500352a4c0..44c52dabf6a1 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -1849,6 +1849,8 @@ arc_buf_try_copy_decompressed_data(arc_buf_t *buf) { arc_buf_hdr_t *hdr = buf->b_hdr; boolean_t copied = B_FALSE; + int cnt = 0; + zio_cksum_t *b_freeze_cksum = NULL; ASSERT(HDR_HAS_L1HDR(hdr)); ASSERT3P(buf->b_data, !=, NULL); @@ -1866,13 +1868,16 @@ arc_buf_try_copy_decompressed_data(arc_buf_t *buf) copied = B_TRUE; break; } + b_freeze_cksum = from->b_hdr->b_l1hdr.b_freeze_cksum; + cnt++; } /* * There were no decompressed bufs, so there should not be a * checksum on the hdr either. */ - EQUIV(!copied, hdr->b_l1hdr.b_freeze_cksum == NULL); + if (cnt > 0) + EQUIV(!copied, b_freeze_cksum == NULL); return (copied); }