mirror_zfs/lib
Brian Behlendorf 83bf769d50 Fix 'zpool import' detection issues
This patch addresses multiple 'zpool import' block device
indentification problems which are most likely to occur on a
system configured to use blkid, by_vdev paths, multipath and
failover.  The symptom most commonly observed is the import
uses different path names to import the pool than would
normally be expected.

* When using blkid to identify vdevs the listed devices may
be added to the cache in any order.  In order to apply the
preferred search order heuristic a zfs_path_order() function
was added to calculate the order given full path names.

* Since it's possible to have multiple block devices with
different vdev guids which refer to the same ZPOOL_CONFIG_PATH
the slice cache must be indexed by guid and name.  By avoiding
collisions the preferred ordering can be maintaining even
when multiple block devices claim the same ZPOOL_CONFIG_PATH.
The preferred sorting by partition was never benefitial for
a Linux system and was removed as part of this change.

* When adding entries to the blkid cache avl_find/avl_insert
are used instead of avl_add because collisions are possible
and must be handled gracefully.

* For pools using multipath devices there are, at a minimum,
three devices where a vdev label may be read.  They are the
dm-* device and each underlying /dev/sd* device.  Due to the
way the block cache is implemented each of these devices may
have a different cached copy of the vdev label.  This can
result in "ghost pools" which appear to persist even after
a 'zpool labelclear' has been done to the dm-* device.  In
order to prevent this the vdev label is read with O_DIRECT
in order to bypass any caching to get the on-disk version.

* When opening a block device verify that vdev guid read from
the disk matches the expected vdev guid.  This allows for bad
labels to be filtered out.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5359
2016-11-07 10:28:57 -08:00
..
libavl Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
libefi Fixes for issues found with cppcheck tool 2016-07-27 13:31:22 -07:00
libicp OpenZFS 4185 - add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R 2016-10-03 14:51:15 -07:00
libnvpair Add support for libtirpc 2016-04-28 09:27:40 -07:00
libshare Fix coverity defects: CID 147548 2016-10-31 16:56:10 -07:00
libspl Fix coverity defects: CID 150921, 150927 2016-10-14 09:40:08 -07:00
libunicode Support parallel build trees (VPATH builds) 2015-07-17 13:42:51 -07:00
libuutil Fixes for issues found with cppcheck tool 2016-07-27 13:31:22 -07:00
libzfs Fix 'zpool import' detection issues 2016-11-07 10:28:57 -08:00
libzfs_core DLPX-40252 integrate EP-476 compressed zfs send/receive 2016-09-13 09:58:58 -07:00
libzpool Add superscalar fletcher4 2016-11-04 10:53:03 -07:00
Makefile.am Illumos Crypto Port module added to enable native encryption in zfs 2016-07-20 10:43:30 -07:00