File s390-tools-sles11sp2-ziomon-sdev-multipath-blacklist.patch of Package s390-tools

Subject: [PATCH] [BZ 88164] ziomon: cope with scsi disks not part of multipath device
From: Steffen Maier <maier@linux.vnet.ibm.com>

Description:  ziomon: cope with scsi disks not part of multipath device
Symptom:      # ziorep_config -M
              or
              # ziorep_config -M -i some.cfg
              Use of uninitialized value within %mapper_dev in \
               concatenation (.) or string at /usr/sbin/ziorep_config \
               line 305.
              ...
              or
              Use of uninitialized value in concatenation (.) or string \
               at /usr/sbin/ziorep_config line 305.
              ...
              or
              Use of uninitialized value in string eq at \
               /sbin/ziorep_config line 161.
              Use of uninitialized value in concatenation (.) or string \
               at /sbin/ziorep_config line 337.
              ...
Problem:      ziorep_config did not correctly ignore scsi disks, that are
              not part of a multipath device, when creating the multipath
              mapper report. get_line() returns "n/a" if the sysfs
              attribute does not exist. This is stored in the value for
              hash key mp_dev_mm so its value cannot be used in a check for
              being undefined.
Solution:     The hash field mp_dev remains undefined, if no multipath
              device was found, so use this to ignore scsi disks,
              that are not part of a multipath device.
Reproduction: Blacklist some scsi disks in /etc/multipath.conf
              or dynamically delete some path from a pathgroup with
              "multipathd -k'del path sdd'" or remove some multipath map
              that includes scsi disks by means of "multipath -f <map>".
              In addition, have at least one multipath device configured.
              Run "ziorep_config -M", or collect configuration data
              by means of "ziomon -o some ..." or "ziomon_fcpconf -o some"
              and then run "ziorep_config -M -i some.cfg".
Upstream-ID:  -
Problem-ID:   88164

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
---
 ziomon/ziorep_config |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/ziomon/ziorep_config
+++ b/ziomon/ziorep_config
@@ -293,7 +293,7 @@ sub mapper_report
 		      "=====================================================\n";
 	}
 	foreach my $hctl (sort keys %devices) {
-		next if (! $devices{$hctl}{mp_dev_mm});
+		next if (! $devices{$hctl}{mp_dev});
 		next if (@$adapters && "@$adapters" !~ /\b$devices{$hctl}{hba_id}\b/);
 		next if (@$ports && "@$ports" !~ /\b$devices{$hctl}{wwpn}\b/);
 		next if (@$s_devs && "@$s_devs" !~ /\b$devices{$hctl}{dev}\b/);
openSUSE Build Service is sponsored by