From 24e61911f0442e380d2bbe4a4d0ddf805bf6ca5b Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Fri, 10 Mar 2023 17:42:09 -0500 Subject: [PATCH] Zero zio_prop_t in flush_write_batch_impl() After 67a1b0379159c46bcd60a462a2790248046c8804 was merged, coverity started complaining about an uninitialized scalar variable in flush_write_batch_impl() due to the new field zp.zp_brtwrite. Upon inspection, it appears that uninitialized memory was being copied for non-raw streams, so this is a pre-existing issue. The addition of zp_brtwrite by the block cloning commit caused Coverity to begin to notice it. Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Reviewed-by: Rob Norris Signed-off-by: Richard Yao Reported-by: Coverity (CID-1535378) Closes #14607 --- module/zfs/dmu_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/dmu_recv.c b/module/zfs/dmu_recv.c index 50378f8db..2647eb052 100644 --- a/module/zfs/dmu_recv.c +++ b/module/zfs/dmu_recv.c @@ -2225,7 +2225,7 @@ flush_write_batch_impl(struct receive_writer_arg *rwa) if (err == 0) abd_free(abd); } else { - zio_prop_t zp; + zio_prop_t zp = {0}; dmu_write_policy(rwa->os, dn, 0, 0, &zp); zio_flag_t zio_flags = 0;