Skip to content

Commit

Permalink
ZTS: get_persistent_disk_name can return truncated names
Browse files Browse the repository at this point in the history
Instead of using only the 3rd element return the entire string after 
the split to handle device names with dashes.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Vaibhav Bhanawat <vaibhav.bhanawat@delphix.com>
Closes openzfs#15567
  • Loading branch information
vaibhav-delphix authored and lundman committed Dec 12, 2023
1 parent 1d2490e commit 7491107
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/zfs-tests/include/blkdev.shlib
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ function get_persistent_disk_name #device
if is_linux; then
if is_real_device $device; then
udevadm info -q all -n $DEV_DSKDIR/$device \
| awk '/disk\/by-id/ {print $2; exit}' | cut -d/ -f3
| awk '/disk\/by-id/ {print $2; exit}' | cut -d/ -f3-
elif is_mpath_device $device; then
udevadm info -q all -n $DEV_DSKDIR/$device \
| awk '/disk\/by-id\/dm-uuid/ {print $2; exit}' \
Expand Down

0 comments on commit 7491107

Please sign in to comment.