HomeFreeBSD

Fix vdev_open_child() race on updating vdev_parent->vdev_nonrot

Description

Fix vdev_open_child() race on updating vdev_parent->vdev_nonrot

Updating vd->vdev_parent->vdev_nonrot in vdev_open_child()
is a race when vdev_open_child is called for many children
from a task queue.

vdev_open_child() is only called by vdev_open_children(), let
the latter update the parent vdev_nonrot member. The update
was already there, so done twice previously. Thus using the
same logic at the end in vdev_open_children() to update
vdev_nonrot, either we are vdev_uses_zvols() or not.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Haakan T Johansson <f96hajo@chalmers.se>
Closes #5162

Details

Provenance
Håkan Johansson <f96hajo@chalmers.se>Authored on Oct 7 2016, 8:25 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Oct 7 2016, 8:25 PM
Parents
rGccc92611b1bd: Fix coverity defects: CID 147565-147567
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG4770aa0643a7: Fix vdev_open_child() race on updating vdev_parent->vdev_nonrot (authored by Håkan Johansson <f96hajo@chalmers.se>).Oct 7 2016, 8:25 PM