diff options
author | Tony Hutter <hutter2@llnl.gov> | 2021-10-20 15:48:04 -0700 |
---|---|---|
committer | Tony Hutter <hutter2@llnl.gov> | 2021-11-02 16:31:11 -0700 |
commit | d11b03ed81a011fc5815b0219a5b3d029d753f46 (patch) | |
tree | 0b3f1255fb34777e572703193a72466d27fd77e5 | |
parent | 586b5d366edfaaed28a9b39b89e20350226edf97 (diff) |
vdev_id: Fix enclosure_symlinks feature
The vdev_id.conf "enclosure_symlinks" option persistently creates
and maps /dev/by-enclosure symlinks to dynamic /dev/sg* devices.
This patch fixes two issues:
1. The enclosure_symlinks feature was accidentally broken in:
vdev_id: Support daisy-chained JBODs in multipath mode
2. Even when working, the feature numbered the enclosure
sequentially rather than by HBA port number. That meant that
if a port was down or didn't appear in sysfs, then the
enclosure_sumlinks numbers would be numbered wrong.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #12660
-rwxr-xr-x | cmd/vdev_id/vdev_id | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index cad59c93f..ab9d7326f 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -622,8 +622,8 @@ enclosure_handler () { PCI_ID=$(echo "$PCI_ID_LONG" | sed -r 's/^[0-9]+://g') # Name our device according to vdev_id.conf (like "L0" or "U1"). - NAME=$(awk '/channel/{if ($1 == "channel" && $2 == "$PCI_ID" && \ - $3 == "$PORT_ID") {print ${4}int(count[$4])}; count[$4]++}' $CONFIG) + NAME=$(awk "/channel/{if (\$1 == \"channel\" && \$2 == \"$PCI_ID\" && \ + \$3 == \"$PORT_ID\") {print \$4\$3}}" $CONFIG) echo "${NAME}" } |