diff options
author | LOLi <[email protected]> | 2017-12-09 01:58:41 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-12-08 16:58:41 -0800 |
commit | 4e9b156960562373e005798575a3fbc6d66e32ff (patch) | |
tree | a554474cae9721dbb6756620e5009b1fa4f31ad6 /tests/zfs-tests/include/libtest.shlib | |
parent | 3ab3166347b84c6004002f9a6d06f7a87fe1cd4a (diff) |
Various ZED fixes
* Teach ZED to handle spares usingi the configured ashift: if the zpool
'ashift' property is set then ZED should use its value when kicking
in a hotspare; with this change 512e disks can be used as spares
for VDEVs that were created with ashift=9, even if ZFS natively
detects them as 4K block devices.
* Introduce an additional auto_spare test case which verifies that in
the face of multiple device failures an appropiate number of spares
are kicked in.
* Fix zed_stop() in "libtest.shlib" which did not correctly wait the
target pid.
* Fix ZED crashing on startup caused by a race condition in libzfs
when used in multi-threaded context.
* Convert ZED over to using the tpool library which is already present
in the Illumos FMA code.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes #2562
Closes #6858
Diffstat (limited to 'tests/zfs-tests/include/libtest.shlib')
-rw-r--r-- | tests/zfs-tests/include/libtest.shlib | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index 6b1658c1b..cc9fddd41 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -3158,14 +3158,26 @@ function zed_stop if [[ -f ${ZEDLET_DIR}/zed.pid ]]; then zedpid=$(cat ${ZEDLET_DIR}/zed.pid) kill $zedpid - wait $zedpid + while ps -p $zedpid > /dev/null; do + sleep 1 + done rm -f ${ZEDLET_DIR}/zed.pid fi - return 0 } # +# Drain all zevents +# +function zed_events_drain +{ + while [ $(zpool events -H | wc -l) -ne 0 ]; do + sleep 1 + zpool events -c >/dev/null + done +} + +# # Check is provided device is being active used as a swap device. # function is_swap_inuse |