]> granicus.if.org Git - zfs/commit
Fix 'zpool import' detection issue
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 14 Nov 2016 17:40:18 +0000 (09:40 -0800)
committerGitHub <noreply@github.com>
Mon, 14 Nov 2016 17:40:18 +0000 (09:40 -0800)
commitc30d8ded0c8c64a9a144cf478502bb4e512ab9fa
tree60e21c532e940062aac2adc5ffb9897e341b650b
parent0df15db98f185c948239c236c9e51d7ce14adb71
Fix 'zpool import' detection issue

Before adding the entry to the configuration verify that the
device can be opened exclusively.  This ensures that as long
as multipathd is running the underlying multipath devices, which
otherwise appear identical to their /dev/mapper counterpart,
are pruned from the configuration.

Failure to do so can result in a result in the vdev appearing
as UNAVAIL when the vdev path provided to the kernel can't be
opened exclusively.

This check would normally be performed in zpool_open_func()
but placing it there would result in false positives because
it is called concurrently for many devices.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5387
lib/libzfs/libzfs_import.c