Skip to content

Commit

Permalink
Fix io-spare.sh to work with disk vdevs
Browse files Browse the repository at this point in the history
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 openzfs#3310
  • Loading branch information
dun authored and behlendorf committed Apr 17, 2015
1 parent 7fad629 commit de6d197
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/zed/zed.d/io-spare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ flock -x 8
# Given a <pool> and <device> return the status, (ONLINE, FAULTED, etc...).
vdev_status() {
local POOL=$1
local VDEV=$2
local VDEV=`basename $2`
local T=' ' # tab character since '\t' isn't portable

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

0 comments on commit de6d197

Please sign in to comment.