chiark / gitweb /
extras: ata_id - do not log error if HDIO_GET_IDENTITY fails
[elogind.git] / src / udev-builtin-path_id.c
index b18b162755880b5d4c35fbc313ec00052d2b0c9e..a8559d2dd4118ac89feb03b7db8ef364caa73a0b 100644 (file)
@@ -265,6 +265,11 @@ static struct udev_device *handle_scsi_default(struct udev_device *parent, char
                 i = strtoul(&dent->d_name[4], &rest, 10);
                 if (rest[0] != '\0')
                         continue;
+                /*
+                 * find the smallest number; the host really needs to export its
+                 * own instance number per parent device; relying on the global host
+                 * enumeration and plainly rebasing the numbers sounds unreliable
+                 */
                 if (basenum == -1 || i < basenum)
                         basenum = i;
         }
@@ -317,6 +322,19 @@ static struct udev_device *handle_scsi(struct udev_device *parent, char **path)
                 goto out;
         }
 
+        /*
+         * We do not support the ATA transport class, it creates duplicated link
+         * names as the fake SCSI host adapters are all separated, they are all
+         * re-based as host == 0. ATA should just stop faking two duplicated
+         * hierarchies for a single topology and leave the SCSI stuff alone;
+         * until that happens, there are no by-path/ links for ATA devices behind
+         * an ATA transport class.
+         */
+        if (strstr(name, "/ata") != NULL) {
+                parent = NULL;
+                goto out;
+        }
+
         parent = handle_scsi_default(parent, path);
 out:
         return parent;