Bug#782400: multipath-tools: libmultipath: fix discovery of devices with empty rev sysfs attribute

Mauricio Faria de Oliveira mauricfo at linux.vnet.ibm.com
Mon Apr 13 00:22:35 UTC 2015


Oops, please use this version (-v2).

When the forwarded patch is applied in the source package, the change
ends up in cciss_sysfs_pathinfo() rather than scsi_sysfs_pathinfo():

     Hunk #1 succeeded at 783 (offset -312 lines).

This version has the change in the right place, plus quilt refresh.

Thanks!


-- 
Mauricio Faria de Oliveira
IBM Linux Technology Center


-------------- next part --------------
diff -Nru multipath-tools-0.5.0/debian/changelog multipath-tools-0.5.0/debian/changelog
--- multipath-tools-0.5.0/debian/changelog	2015-04-13 05:26:21.000000000 +0530
+++ multipath-tools-0.5.0/debian/changelog	2015-04-13 05:30:14.000000000 +0530
@@ -1,3 +1,9 @@
+multipath-tools (0.5.0-6pathselector1blankrev1) UNRELEASED; urgency=medium
+
+  * 0014-libmultipath-discovery-blank-rev-attr.patch: fix discovery of devices with blank rev.
+
+ -- Mauricio Faria de Oliveira <mauricfo at linux.vnet.ibm.com>  Sat, 11 Apr 2015 12:40:19 -0300
+
 multipath-tools (0.5.0-6pathselector1) UNRELEASED; urgency=medium
 
   * initramfs/hooks: include dm-service-time in initramfs (new default path selector).
diff -Nru multipath-tools-0.5.0/debian/patches/0014-libmultipath-discovery-blank-rev-attr.patch multipath-tools-0.5.0/debian/patches/0014-libmultipath-discovery-blank-rev-attr.patch
--- multipath-tools-0.5.0/debian/patches/0014-libmultipath-discovery-blank-rev-attr.patch	1970-01-01 05:30:00.000000000 +0530
+++ multipath-tools-0.5.0/debian/patches/0014-libmultipath-discovery-blank-rev-attr.patch	2015-04-13 05:31:34.000000000 +0530
@@ -0,0 +1,37 @@
+Forwarded: https://www.redhat.com/archives/dm-devel/2015-April/msg00049.html
+From b7ec63e727880aa709c2aa7b6029dba9ad7d9d74 Mon Sep 17 00:00:00 2001
+From: Mauricio Faria de Oliveira <mauricfo at linux.vnet.ibm.com>
+Date: Sat, 11 Apr 2015 12:02:29 -0300
+Subject: [PATCH] libmultipath: fix discovery of devices with sysfs attr containing only spaces
+
+commit 43c61e979521b17d9f50ea8e722682c33d0b7d69 causes sysfs_get_<attr>() to
+return 0 if attr contains only spaces, and scsi_sysfs_pathinfo() to return 1
+in 'if (sysfs_get_<attr>() <= 0)'; this breaks the device's discovery.
+
+Changing the comparison operator '<=' to '<' allows discovery to continue.
+
+This affects some IPR controllers (rev sysfs attr):
+
+	# grep . /sys/block/sda/device/{vendor,model,rev} | tr ' ' '#'
+	/sys/block/sda/device/vendor:IBM#####
+	/sys/block/sda/device/model:IPR-0###5EC99A00
+	/sys/block/sda/device/rev:####
+
+Signed-off-by: Mauricio Faria de Oliveira <mauricfo at linux.vnet.ibm.com>
+---
+ libmultipath/discovery.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+Index: multipath-tools-0.5.0/libmultipath/discovery.c
+===================================================================
+--- multipath-tools-0.5.0.orig/libmultipath/discovery.c
++++ multipath-tools-0.5.0/libmultipath/discovery.c
+@@ -661,7 +661,7 @@ scsi_sysfs_pathinfo (struct path * pp)
+ 
+ 	condlog(3, "%s: product = %s", pp->dev, pp->product_id);
+ 
+-	if (sysfs_get_rev(parent, pp->rev, SCSI_REV_SIZE) <= 0)
++	if (sysfs_get_rev(parent, pp->rev, SCSI_REV_SIZE) < 0)
+ 		return 1;
+ 
+ 	condlog(3, "%s: rev = %s", pp->dev, pp->rev);
diff -Nru multipath-tools-0.5.0/debian/patches/series multipath-tools-0.5.0/debian/patches/series
--- multipath-tools-0.5.0/debian/patches/series	2014-09-05 17:42:48.000000000 +0530
+++ multipath-tools-0.5.0/debian/patches/series	2015-04-13 05:30:14.000000000 +0530
@@ -4,3 +4,4 @@
 0011-patch-udev-rule.patch
 0012-format-security-build-fixes.patch
 0013-fix-spelling-error.patch
+0014-libmultipath-discovery-blank-rev-attr.patch


More information about the pkg-lvm-maintainers mailing list