Leaf vdevs should not be reopened
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 26 Feb 2013 19:25:55 +0000 (11:25 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 28 Feb 2013 20:02:59 +0000 (12:02 -0800)
commit0d8103d9561bd2314da320dd5d43f9d5e044b64d
treeeac8f08332646b8112e86c88e6979b5f4a28ff2b
parentc5b247f3354d5c9e24577af997c84d90625620a6
Leaf vdevs should not be reopened

When vdev_disk.c was implemented for Linux we failed to handle the
reopen case.  According to the vdev_reopen() comment leaf vdevs should
not be closed or opened when v->vdev_reopening is set.  Under Linux
we would always close and open the device.

This issue was only noticed when a 'zpool scrub' command was run while
the leaf vdev device names in /dev/disk/by-vdev were missing.  The
scrub command calls vdev_reopen() which caused the vdevs to be closed
but they couldn't be reopened due to the missing links.  The result
was that all the vdevs were marked unavailable and the pool was
halted due to failmode=wait.

This patch adds the missing functionality in a similiar fashion to
to the Illumos code.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
module/zfs/vdev_disk.c