Skip to content

Commit 4ec7b85

Browse files
dunbehlendorf
authored andcommitted
Fix io-spare.sh to work with disk vdevs
The "zpool status" output shows the full pathname for file-type vdevs, but only the basename component for disk-type vdevs. In commit bee6665, the "basename" command was dropped from altering the vdev name used when searching the "zpool status" output. Consequently, hot-disk sparing for disk vdevs broke since "zpool status" output was now being searched for the full pathname to the disk vdev. Parsing the "zpool status" output in this manner is rather brittle. It would be preferable to search for the vdev based on its guid. But until that happens, this commit adds back the "basename" command to fix the vdev name breakage. Signed-off-by: Chris Dunlap <cdunlap@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3310
1 parent e548a59 commit 4ec7b85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/zed/zed.d/io-spare.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ flock -x 8
5454
# Given a <pool> and <device> return the status, (ONLINE, FAULTED, etc...).
5555
vdev_status() {
5656
local POOL=$1
57-
local VDEV=$2
57+
local VDEV=`basename $2`
5858
local T=' ' # tab character since '\t' isn't portable
5959

6060
${ZPOOL} status ${POOL} | sed -n -e \

0 commit comments

Comments
 (0)