From b01a8cc2c0fe6ee4af05bb0b1911afcbd39da64b Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 11 May 2023 17:27:12 -0400 Subject: [PATCH] zil: Don't expect zio_shrink() to succeed. At least for RAIDZ zio_shrink() does not reduce zio size, but reduced wsz in that case likely results in writing uninitialized memory. Reviewed-by: Brian Behlendorf Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #14853 --- module/zfs/zil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/module/zfs/zil.c b/module/zfs/zil.c index 0456d3801f..cca0610407 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -1593,6 +1593,7 @@ zil_lwb_write_issue(zilog_t *zilog, lwb_t *lwb) wsz = P2ROUNDUP_TYPED(lwb->lwb_nused, ZIL_MIN_BLKSZ, uint64_t); ASSERT3U(wsz, <=, lwb->lwb_sz); zio_shrink(lwb->lwb_write_zio, wsz); + wsz = lwb->lwb_write_zio->io_size; } else { wsz = lwb->lwb_sz;