ZTS: get_persistent_disk_name can return truncated names
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 #15567
This commit is contained in:
parent
1c38cdfe98
commit
7d68900af3
|
@ -289,7 +289,7 @@ function get_persistent_disk_name #device
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
if is_real_device $device; then
|
if is_real_device $device; then
|
||||||
udevadm info -q all -n $DEV_DSKDIR/$device \
|
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
|
elif is_mpath_device $device; then
|
||||||
udevadm info -q all -n $DEV_DSKDIR/$device \
|
udevadm info -q all -n $DEV_DSKDIR/$device \
|
||||||
| awk '/disk\/by-id\/dm-uuid/ {print $2; exit}' \
|
| awk '/disk\/by-id\/dm-uuid/ {print $2; exit}' \
|
||||||
|
|
Loading…
Reference in New Issue