Skip to content

Commit ff6266e

Browse files
authored
Fix use-afer-free regression in RAIDZ expansion
We should not dereference rra after the last zio_nowait() is called. It seems very unlikely, but ASAN in ztest managed to catch it. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Sponsored by: iXsystems, Inc. Closes #16868
1 parent 586304a commit ff6266e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

module/zfs/vdev_raidz.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,8 +3914,8 @@ raidz_reflow_read_done(zio_t *zio)
39143914

39153915
if (atomic_dec_32_nv(&rra->rra_tbd) > 0)
39163916
return;
3917-
rra->rra_tbd = rra->rra_writes;
3918-
for (uint64_t i = 0; i < rra->rra_writes; i++)
3917+
uint32_t writes = rra->rra_tbd = rra->rra_writes;
3918+
for (uint64_t i = 0; i < writes; i++)
39193919
zio_nowait(rra->rra_zio[i]);
39203920
}
39213921

0 commit comments

Comments
 (0)