File s390-tools-sles11sp2-ziomon-symlinks-multipath-devices.patch of Package s390-tools

Subject: [PATCH] [BZ 87092] ziomon: follow symlinks to find multipath devices
From: Steffen Maier <maier@linux.vnet.ibm.com>

Description:  ziomon: follow symlinks to find multipath devices
Symptom:      # ziorep_config -M -i some.cfg
              Use of uninitialized value within %mapper_dev in \
               concatenation (.) or string at /usr/sbin/ziorep_config \
               line 305.
              ...
              # ziorep_traffic some.log -C m
              ...
              ziorep_traffic: No multipath devices in configuration found. \
               Aggregation by multipath devices not possible with this data.
              # ziorep_traffic some.log -m mpatha
              ...
              Error: Could not find multipath device mpatha in \
               configuration.
Problem:      ziomon_fcpconf did not follow symlinks
              when retrieving major:minor number for device mapper
              devices under /dev/mapper/ where typically only symbolic
              links are found. Dm devices ended up as n/a with 0:0 in
              the ziomon config and could thus not be found by the
              analysis tools of ziomon.
Solution:     Follow symlinks on retrieving major:minor numbers for
              device mapper devices under /dev/mapper/.
Reproduction: Have device mapper multipathing configured and execute
              any of the ziomon tools dealing with printing collected
              multipath configuration or with analysis of collected
              performance data requesting collapsing by multipath
              devices or specifying multipath device(s) as filter.
Upstream-ID:  -
Problem-ID:   87092

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

--- a/ziomon/ziomon_fcpconf
+++ b/ziomon/ziomon_fcpconf
@@ -58,7 +58,7 @@ sub store_mapper_devices
 
 	foreach my $map_dev (@entries) {
 		my $tf = catfile($src_dir, "$map_dev");
-		my $mm = `stat -c%t:%T $tf`;
+		my $mm = `stat -L -c%t:%T $tf`;
 		chomp($mm);
 		$mm = join(":", map { hex($_) } split(":", $mm));
 		system("echo $mm > " .  catfile($dest_dir, $src_dir, $map_dev));
openSUSE Build Service is sponsored by