- lsluns: uninitialized value on adapter offline (#611795)

- zfcpdbf: Fix 'Use of uninitialized value' and output issues (#612622)
This commit is contained in:
Dan Horák 2010-07-13 15:35:14 +00:00
parent 9e27916392
commit 32f454a29c
3 changed files with 127 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 76e25ac419c3f23c0cdbfcd2db64bf196d806994 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 13 Jul 2010 15:27:26 +0200
Subject: [PATCH 42/43] lsluns: uninitialized value on adapter offline
Description: lsluns: uninitialized value on adapter offline.
Symptom: An error message is presented stating that some values
are not initialized while an operation is due.
Problem: The program execution is not reflection the offline adapter
status.
Solution: Account for offlined adapter status and show an appropriate
message.
---
zconf/lsluns | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/zconf/lsluns b/zconf/lsluns
index 9227f64..769b846 100755
--- a/zconf/lsluns
+++ b/zconf/lsluns
@@ -211,7 +211,11 @@ sub show_attached_lun_info
print "\tport = $p\n";
foreach my $l (sort keys %{$lun_hash{$a}{$p}}) {
my $sg_dev = "/dev/".$lun_hash{$a}{$p}{$l};
- my $inq = `sg_inq -r $sg_dev`;
+ my $inq = `sg_inq -r $sg_dev 2>/dev/null`;
+ if (!$inq) {
+ print("\t\tlun = $l [offline]\n");
+ next;
+ }
(my $vend = substr($inq, 0x8, 0x8)) =~ s/\s*//g;
(my $mod = substr($inq, 0x10, 0x10)) =~ s/\s*//g;
my $type = ord(substr($inq, 0x0, 0x1));
--
1.7.1.1

View File

@ -0,0 +1,78 @@
From e1f4564972a7d280badf24568d56c063b6ce0ca7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
Date: Tue, 13 Jul 2010 15:29:42 +0200
Subject: [PATCH 43/43] zfcpdbf: Fix "Use of uninitialized value" and output issues
Description: zfcpdbf: Fix "Use of uninitialized value" and output issues
Symptom: zfcpdbf outputs the error "Use of uninitialized value".
Problem: zfcpdbf tried to output attributes for "status read"
commands that do not exist. It also tried to output the
attribute port_handle for ELS requests that does not exist.
Solution: Exit early for "status read" requests, there is no additional
FSF command data. Remove output of LS field for ELS requests.
It was wrong, and newer dbf does not have this redundant field.
For consistency, add devno and timestamp to output of "status
read".
---
scripts/zfcpdbf | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/scripts/zfcpdbf b/scripts/zfcpdbf
index 0b75c43..f82044d 100755
--- a/scripts/zfcpdbf
+++ b/scripts/zfcpdbf
@@ -375,11 +375,13 @@ sub print_hba {
}
elsif(defined($hba_hash{'tag2'}) &&
$hba_hash{'tag2'} eq "dism") {
- print "status read request dissmissed";
+ print "$adapter $hba_hash{'timestamp'} " .
+ "status read request dismissed";
}
elsif(defined($hba_hash{'tag2'}) &&
$hba_hash{'tag2'} eq "fail") {
- print "status read request failed";
+ print "$adapter $hba_hash{'timestamp'} " .
+ "status read request failed";
}
}
elsif(defined($hba_hash{'tag'}) && $hba_hash{'tag'} eq "resp") {
@@ -398,9 +400,14 @@ sub print_hba {
}
}
else {
- next;
+ return;
}
-
+
+ if ($hba_hash{'tag'} eq 'stat') {
+ print "\n";
+ return;
+ }
+
if($OPT_VERBOSE) {
print "protocol status qualifier=" .
"'$hba_hash{'fsf_prot_status_qual'}'" . $endl .
@@ -410,7 +417,7 @@ sub print_hba {
"'$hba_hash{'fsf_req_status'}'" . $endl .
"SBAL=$hba_hash{'sbal_first'}/$hba_hash{
'sbal_last'}/$hba_hash{'sbal_response'} " .
- "(fist/last/response)" . $endl;
+ "(first/last/response)" . $endl;
}
if($hba_hash{'fsf_command'} eq '0x00000002') {
@@ -432,8 +439,7 @@ sub print_hba {
" LUN handle=$hba_hash{'lun_handle'}";
}
elsif($hba_hash{'fsf_command'} eq '0x0000000b' ) {
- print "D_ID=$hba_hash{'d_id'} LS " .
- "code=$hba_hash{'port_handle'}";
+ print "D_ID=$hba_hash{'d_id'}";
}
print"\n";
}
--
1.7.1.1

View File

@ -8,7 +8,7 @@ Name: s390utils
Summary: Utilities and daemons for IBM System/z
Group: System Environment/Base
Version: 1.8.2
Release: 28%{?dist}
Release: 29%{?dist}
Epoch: 2
License: GPLv2 and GPLv2+ and CPL
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -79,6 +79,8 @@ Patch38: 0038-cpuplugd-fix-stack-overflow.patch
Patch39: 0039-cpuplugd-fix-cmm-limits-checks.patch
Patch40: 0040-cpuplugd-set-cpu_min-to-1-by-default.patch
Patch41: 0041-fix-dates-option-on-zfcpdbf.patch
Patch42: 0042-lsluns-uninitialized-value-on-adapter-offline.patch
Patch43: 0043-zfcpdbf-Fix-Use-of-uninitialized-value-and-output-is.patch
Patch1000: 1000-ziomon-linker.patch
@ -233,6 +235,12 @@ be used together with the zSeries (s390) Linux kernel and device drivers.
# Fix --dates option in zfcpdbf (#609092)
%patch41 -p1 -b .zfcpdbf-dates
# lsluns: uninitialized value on adapter offline (#611795)
%patch42 -p1 -b .lsluns-adapter-offline
# zfcpdbf: Fix 'Use of uninitialized value' and output issues (#612622)
%patch43 -p1 -b .zfcpdbf-uninitialized-value
# Fix linking with --no-add-needed
%patch1000 -p1 -b .linker
@ -943,6 +951,10 @@ User-space development files for the s390/s390x architecture.
%changelog
* Tue Jul 13 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-29
- lsluns: uninitialized value on adapter offline (#611795)
- zfcpdbf: Fix 'Use of uninitialized value' and output issues (#612622)
* Wed Jul 7 2010 Dan Horák <dan[at]danny.cz> 2:1.8.2-28
- fix linking with --no-add-needed