freebsd-dev/sys/cddl/contrib/opensolaris/uts
Alexander Motin f106f43aa2 Matching GUIDs, handle possible race on vdev detach.
In case of vdev detach, causing top level mirror vdev destruction, leaf
vdev changes its GUID to one of the destroyed mirror, that creates race
condition when GUID in vdev label may not match one in the pool config.

This change replicates logic nuance of vdev_validate() by adding special
exception, matching the vdev GUID against the top level vdev GUID.
Since this exception is not completely reliable (may give false positives
if we fail to erase label on detached vdev), use it only as last resort.

Quick way to reproduce this scenario now is detach vdev from a pool with
enabled autoextend.  During vdev detach autoextend logic tries to reopen
remaining vdev, that always fails now since in-memory configuration is
already updated, while on-disk labels are not yet.

MFC after:	2 weeks
2016-10-28 16:21:31 +00:00
..
aarch64 First cut of DTrace for AArch64. 2015-07-01 15:51:11 +00:00
arm Initial version of DTrace on ARM32. 2015-02-10 19:41:30 +00:00
common Matching GUIDs, handle possible race on vdev detach. 2016-10-28 16:21:31 +00:00
intel Move implementations of uread() and uwrite() to the illumos compat layer. 2016-09-24 21:40:14 +00:00
mips
powerpc Move implementations of uread() and uwrite() to the illumos compat layer. 2016-09-24 21:40:14 +00:00
riscv Add initial DTrace support for RISC-V. 2016-05-24 16:41:37 +00:00