From 88f88d11ecee7d753e9b43d67001d58c56789eb1 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Thu, 20 Mar 2008 23:53:48 +0100 Subject: [PATCH] [libmultipath] Update discovery to work with new sysfs layout With the new sysfs layout the parent device of a block device it 'block', and only the parent of this is the 'real' parent. --- libmultipath/discovery.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c index a85a248..30c36e5 100644 --- a/libmultipath/discovery.c +++ b/libmultipath/discovery.c @@ -550,6 +550,9 @@ sysfs_pathinfo(struct path * pp) if (!parent) parent = pp->sysdev; + if (!strncmp(parent->kernel, "block",5)) + parent = sysfs_device_get_parent(parent); + condlog(3, "%s: subsystem = %s", pp->dev, parent->subsystem); if (!strncmp(parent->subsystem, "scsi",4)) -- 2.7.4