On 04/11/2015 01:00 PM, Mauricio Faria de Oliveira wrote:
Tags: patch

It helps to attach the patch :)

--
Mauricio Faria de Oliveira
IBM Linux Technology Center
diff -Nru multipath-tools-0.5.0/debian/changelog 
multipath-tools-0.5.0/debian/changelog
--- multipath-tools-0.5.0/debian/changelog      2015-03-04 05:53:28.000000000 
-0300
+++ multipath-tools-0.5.0/debian/changelog      2015-04-11 12:48:01.000000000 
-0300
@@ -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 <mauri...@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
       1969-12-31 21:00:00.000000000 -0300
+++ 
multipath-tools-0.5.0/debian/patches/0014-libmultipath-discovery-blank-rev-attr.patch
       2015-04-11 12:48:06.000000000 -0300
@@ -0,0 +1,40 @@
+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 <mauri...@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 <mauri...@linux.vnet.ibm.com>
+---
+ libmultipath/discovery.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
+index 4582a20..dde57c0 100644
+--- a/libmultipath/discovery.c
++++ b/libmultipath/discovery.c
+@@ -1095,7 +1095,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);
+-- 
+1.7.1
+
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 09:12:48.000000000 
-0300
+++ multipath-tools-0.5.0/debian/patches/series 2015-04-11 12:48:06.000000000 
-0300
@@ -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

Reply via email to