Blame SOURCES/0263-RHBZ-1686708-nvme-hcil.patch

0fe00a
---
0fe00a
 libmultipath/discovery.c |   11 +++++++++--
0fe00a
 1 file changed, 9 insertions(+), 2 deletions(-)
0fe00a
0fe00a
Index: multipath-tools-130222/libmultipath/discovery.c
0fe00a
===================================================================
0fe00a
--- multipath-tools-130222.orig/libmultipath/discovery.c
0fe00a
+++ multipath-tools-130222/libmultipath/discovery.c
0fe00a
@@ -889,7 +889,7 @@ nvme_sysfs_pathinfo (struct path * pp)
0fe00a
 {
0fe00a
 	struct udev_device *parent;
0fe00a
 	const char *attr_path = NULL;
0fe00a
-
0fe00a
+	const char *attr;
0fe00a
 
0fe00a
 	attr_path = udev_device_get_sysname(pp->udev);
0fe00a
 	if (!attr_path)
0fe00a
@@ -902,10 +902,17 @@ nvme_sysfs_pathinfo (struct path * pp)
0fe00a
 	pp->sg_id.channel = 0;
0fe00a
 	pp->sg_id.lun = 0;
0fe00a
 
0fe00a
-	parent = udev_device_get_parent(pp->udev);
0fe00a
+	parent = udev_device_get_parent_with_subsystem_devtype(pp->udev,
0fe00a
+							       "nvme", NULL);
0fe00a
 	if (!parent)
0fe00a
 		return 1;
0fe00a
 
0fe00a
+	attr = udev_device_get_sysattr_value(pp->udev, "nsid");
0fe00a
+	pp->sg_id.lun = attr ? atoi(attr) : 0;
0fe00a
+
0fe00a
+	attr = udev_device_get_sysattr_value(parent, "cntlid");
0fe00a
+	pp->sg_id.channel = attr ? atoi(attr) : 0;
0fe00a
+
0fe00a
 	snprintf(pp->vendor_id, SCSI_VENDOR_SIZE, "NVME");
0fe00a
 	snprintf(pp->product_id, PATH_PRODUCT_SIZE, "%s",
0fe00a
 		 udev_device_get_sysattr_value(parent, "model"));