mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-04-12 22:51:46 +03:00
Fix vdev_rebuild_range() tx commit
The spa_sync thread waits on ->spa_txg_zio and will set ZIO_WAIT_DONE before running the sync tasks. The dmu_tx_commit() call must be done after we add the child zio to the ->spa_txg_zio parent otherwise its possible the child is added after txg_sync has waited. Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #18276
This commit is contained in:
parent
ac0fd40c8c
commit
0f90a797dd
@ -616,7 +616,6 @@ vdev_rebuild_range(vdev_rebuild_t *vr, uint64_t start, uint64_t size)
|
||||
return (SET_ERROR(EINTR));
|
||||
}
|
||||
mutex_exit(&vd->vdev_rebuild_lock);
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
vr->vr_scan_offset[txg & TXG_MASK] = start + size;
|
||||
vr->vr_pass_bytes_issued += size;
|
||||
@ -626,6 +625,9 @@ vdev_rebuild_range(vdev_rebuild_t *vr, uint64_t start, uint64_t size)
|
||||
abd_alloc(psize, B_FALSE), psize, vdev_rebuild_cb, vr,
|
||||
ZIO_PRIORITY_REBUILD, ZIO_FLAG_RAW | ZIO_FLAG_CANFAIL |
|
||||
ZIO_FLAG_RESILVER, NULL));
|
||||
/* vdev_rebuild_cb releases SCL_STATE_ALL */
|
||||
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user