Zero zio_prop_t in flush_write_batch_impl()

After 67a1b03791 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 <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reported-by: Coverity (CID-1535378)
Closes #14607
This commit is contained in:
Richard Yao 2023-03-10 17:42:09 -05:00 committed by Brian Behlendorf
parent 1c212d1b7c
commit 24e61911f0

View File

@ -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;