HomeFreeBSD

Hold SCL_VDEV when counting leaves

Description

Hold SCL_VDEV when counting leaves

A config lock should be held while vdev_count_leaves() walks the tree,
otherwise the pointers reference may become invalid during the walk.

SCL_VDEV is a minimal lock provided for such uses cases.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #7286

Details

Provenance
Olaf Faaland <faaland1@llnl.gov>Authored on Mar 8 2018, 11:39 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 9 2018, 11:42 PM
Parents
rGebed90a59867: Handle zio_resume and mmp => off
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG743253df70e9: Hold SCL_VDEV when counting leaves (authored by Olaf Faaland <faaland1@llnl.gov>).Mar 9 2018, 11:42 PM