From 469019fb0b2b7ca4bd6c3de5c2f1056a4446f0e3 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 ec9da706a8..c37da89dd4 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -1866,6 +1866,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;