diff options
author | Tony Hutter <[email protected]> | 2018-06-06 09:33:54 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-06-06 09:33:54 -0700 |
commit | f0ed6c744872ec6dc4838947ffc597f4d141864a (patch) | |
tree | c82a6cc535f94c2a1f7656b2224195d9c2b81eda /tests/zfs-tests/include | |
parent | 2d9142c9d4c9db4edcef4777fecfafa4832610cb (diff) |
Add pool state /proc entry, "SUSPENDED" pools
1. Add a proc entry to display the pool's state:
$ cat /proc/spl/kstat/zfs/tank/state
ONLINE
This is done without using the spa config locks, so it will
never hang.
2. Fix 'zpool status' and 'zpool list -o health' output to print
"SUSPENDED" instead of "ONLINE" for suspended pools.
Reviewed-by: Olaf Faaland <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed by: Richard Elling <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes #7331
Closes #7563
Diffstat (limited to 'tests/zfs-tests/include')
-rw-r--r-- | tests/zfs-tests/include/blkdev.shlib | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/zfs-tests/include/blkdev.shlib b/tests/zfs-tests/include/blkdev.shlib index 87ffa8560..5163ea2ae 100644 --- a/tests/zfs-tests/include/blkdev.shlib +++ b/tests/zfs-tests/include/blkdev.shlib @@ -421,7 +421,16 @@ function unload_scsi_debug # function get_debug_device { - lsscsi | nawk '/scsi_debug/ {print $6; exit}' | cut -d / -f3 + for i in {1..10} ; do + val=$(lsscsi | nawk '/scsi_debug/ {print $6; exit}' | cut -d / -f3) + + # lsscsi can take time to settle + if [ "$val" != "-" ] ; then + break + fi + sleep 1 + done + echo "$val" } # |