[lib] fix the scsi state fetching in sysfs
authorChristophe Varoqui <christophe.varoqui@free.fr>
Sun, 2 Nov 2008 00:52:21 +0000 (01:52 +0100)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Sun, 2 Nov 2008 00:52:21 +0000 (01:52 +0100)
Wrong lookup directory for the "state" node

libmultipath/discovery.c

index 3bcee66..a17186b 100644 (file)
@@ -543,6 +543,8 @@ path_offline (struct path * pp)
        parent = sysfs_device_get_parent(pp->sysdev);
        if (!parent)
                parent = pp->sysdev;
+       if (!strncmp(parent->kernel, "block",5))
+               parent = sysfs_device_get_parent(parent);
        if (sysfs_get_state(parent, buff, SCSI_STATE_SIZE))
                return 1;