summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Johnston <markjdb@gmail.com>2021-08-23 14:10:17 -0400
committerBrian Behlendorf <behlendorf1@llnl.gov>2021-08-31 10:30:21 -0700
commit8fc1a04860d6cab98f727ea7a2d3292d0c26d587 (patch)
tree420f3c3b069aa3c6b31c8eea0a934d4231cd2d1b
parent213bb01b2fd567b3f513f2c11e6f8cae09172f04 (diff)
Initialize parity blocks before RAID-Z reconstruction benchmarking
benchmark_raidz() allocates a row to benchmark parity calculation and reconstruction. In the latter case, the parity blocks are left uninitialized, leading to reports from KMSAN. Initialize parity blocks to 0xAA as we do for the data earlier in the function. This does not affect the selected RAID-Z implementation on any of several systems tested. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Mark Johnston <markj@FreeBSD.org> Closes #12473
-rw-r--r--module/zfs/vdev_raidz_math.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/module/zfs/vdev_raidz_math.c b/module/zfs/vdev_raidz_math.c
index 25d76970e..2ce0dc5cc 100644
--- a/module/zfs/vdev_raidz_math.c
+++ b/module/zfs/vdev_raidz_math.c
@@ -465,6 +465,7 @@ benchmark_raidz(void)
raidz_supp_impl_cnt = c; /* number of supported impl */
#if defined(_KERNEL)
+ abd_t *pabd;
zio_t *bench_zio = NULL;
raidz_map_t *bench_rm = NULL;
uint64_t bench_parity;
@@ -492,6 +493,12 @@ benchmark_raidz(void)
bench_rm = vdev_raidz_map_alloc(bench_zio, SPA_MINBLOCKSHIFT,
BENCH_COLS, PARITY_PQR);
+ /* Ensure that fake parity blocks are initialized */
+ for (c = 0; c < bench_rm->rm_row[0]->rr_firstdatacol; c++) {
+ pabd = bench_rm->rm_row[0]->rr_col[c].rc_abd;
+ memset(abd_to_buf(pabd), 0xAA, abd_get_size(pabd));
+ }
+
for (int fn = 0; fn < RAIDZ_REC_NUM; fn++)
benchmark_raidz_impl(bench_rm, fn, benchmark_rec_impl);