]> granicus.if.org Git - zfs/commit
Hold SCL_VDEV when counting leaves
authorOlaf Faaland <faaland1@llnl.gov>
Thu, 8 Mar 2018 23:39:07 +0000 (15:39 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 9 Mar 2018 23:42:54 +0000 (15:42 -0800)
commit743253df70e9d9772cf98fcdd0fb7f42398d4ff8
tree814d3312cd3f7a6862c45b498acf52b07a360b88
parentebed90a598677dfba76c95cf184549dbc1cb6be5
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
module/zfs/vdev.c