lstape, lsluns: handle non-zfcp; lin_tape multiple paths

Bug #1790831 reported by bugproxy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu on IBM z Systems
Fix Released
Medium
Canonical Foundations Team
s390-tools (Ubuntu)
Fix Released
Undecided
Skipper Bug Screeners
Bionic
Fix Released
Undecided
Unassigned

Bug Description

Description: lstape, lsluns: handle non-zfcp; lin_tape multiple paths

Symptom: lstape shows unexpected additional Device suffix numbers in
excess output columns for each additional path of the same
tape/changer driven by the IBM lin_tape device driver
(independent of actual path failover enablement in lin_tape).
It also shows a wrong number of found devices in the header
(without --scsi-only).

lstape prints error about "Unexpected extra argument:" and the
usage for "sg_inq" along with wrong tabular output.

lsluns prints ENOENT error text for "cat" on SCSI device sysfs
attributes hba_id, wwpn, and fcp_lun.

lstape with --verbose option prints ENOENT error text for
"cat" on SCSI device sysfs attributes hba_id and wwpn.

lstape man page: Description of --type and <devbusid> filter
for channel tapes is incomplete. SCSI output description is
incomplete.

lstape shows "N/A" instead of the HBA device bus-ID with
virtio-scsi-ccw.

Problem: s390-tools-1.8.0 before the first upstream commit b627b8d8e1ab
("Initial s390-tools-2.0.0 import") introduced SCSI
tape/changer output for lstape. It used the SCSI device serial
number as lookup key to find a match in IBM lin_tape device
driver proc-fs output for a given SCSI device name. Multiple
paths to the same tape/changer have the same serial number.
Multiple matches cause excess arguments to printf. Explaining
the resulting output, the bash man page says: "The format is
reused as necessary to consume all of the arguments." This
also causes a wrong number of found devices.

The default bash settings have nullglob disabled so if
$SCSI_DEV/scsi_generic* aka
/sys/bus/scsi/devices/*:*:*:*/scsi_generic* does not match
anything, it leaves the glob pattern unmodified and
SG_DEV=$(basename $SG_DEV/*) results in the literal "*". If
$SG_INQ exists, it invoked sg_inq with more than the one
allowed positional argument for a SCSI generic device node
"sg_inq /dev/*". Causing error messages and the usage of
sg_inq to land in $TAPE_SERIAL.

lsluns iterates SCSI generic devices and unconditionally
reads zfcp-specific SCSI device sysfs attributes hba_id, wwpn,
and fcp_lun.

lstape --verbose unconditionally reads zfcp-specific SCSI
device sysfs attributes hba_id and wwpn.

<devbusid> filter missing from synopsis. <device-type> example
at wrong place with <devbusid> filter. <devbusid> filter
option description is a duplicate of <device-type> filter
option description. SCSI output description misses fields.

Lstape only used the zfcp-specific sysfs attribute hba_id.

Solution: Prefer sysfs to find lin_tape device name for SCSI device.
Fallback: The lin_tape proc-fs output format has changed over
the years. The HBA device driver string can contain whitespace
(e.g. "Virtio SCSI HBA") and breaks the field numbers with
tokenized parsing. Grep for the SCSI device name as word (to
skip names with same substring, such as 0:0:1:1 also matching
0:0:1:10) and cut the first field 'Number' (lin_tape device
name suffix). If there is no SCSI column at all [lin_tape
before v2.2.0] (and no SCSI LLDD or other column with a name
accidentally matching an existing SCSI device name), we get no
match and better bail out with the initialized "N/A" for the
lstape column "Device".

To not have to rely on the nullglob setting, explicitly check
for the existence of $SCSI_DEV/scsi_generic before evaluating
SG_DEV=$(basename $SG_DEV/*). Also handle availability of
sg_inq but absence of scsi_generic individually to provide the
user with a hint if only sg is missing.

Simply skip non-zfcp SCSI devices, such as iSCSI or
virtio-scsi-ccw, to not erroneously access absent attributes.

Assume "N/A" for HBA and WWPN of non-zfcp SCSI devices, such
as iSCSI or virtio-scsi-ccw, to not erroneously access absent
zfcp-specific sysfs attributes.

Add <devbusid> filter to synopsis. Move <device-type> example
to <device-type> option. Replace <devbusid> filter option
description. Move existing SCSI output description to a new
subsection and add description of missing fields.

Also search sysfs for an ancestor with subsystem ccw.

Reproduction: Attach more than one path to the same SCSI tape or changer and
load the IBM lin_tape device driver.

Unload sg kernel module.

Attach non-zfcp SCSI devices such as iSCSI or virtio-scsi-ccw.

Attach non-zfcp SCSI devices such as iSCSI or virtio-scsi-ccw.

man lstape

Attach SCSI tape or changer with virtio-scsi-ccw to a KVM
guest and run "lstape --verbose".

This fix will be introduced with s390-tools 2.7.0

https://github.com/ibm-s390-tools/s390-tools/commits/master

Following git-commits are required
ef4dc7a45b1b80c58076a0a317245569d84b2754
cdc787db1ba17dd2c0ed841fd7443bc32be63b65
80e0c41b896e1eeffc594416b4c2787ed29363b6
eba744a25edcc7202068c1d46fd99d4c98c1acf2
4cf8f5f46c0f80b49a2a70854372289c3fda932b
b9b3d2d23069e021693a251a3aadd4eefc30e6ea
34260f17360f1034c562c941b0f879c2204e40b7
d5291eed1c46e1c97831e771b2975575ba268992

bugproxy (bugproxy)
tags: added: architecture-s39064 bugnameltc-170718 severity-medium targetmilestone-inin---
Changed in ubuntu:
assignee: nobody → Skipper Bug Screeners (skipper-screen-team)
affects: ubuntu → linux (Ubuntu)
affects: linux (Ubuntu) → s390-tools (Ubuntu)
summary: - [Ubuntu] lstape, lsluns: handle non-zfcp; lin_tape multiple paths
+ lstape, lsluns: handle non-zfcp; lin_tape multiple paths
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla
Download full text (4.9 KiB)

------- Comment From <email address hidden> 2018-09-05 05:36 EDT-------
Description: lstape, lsluns: handle non-zfcp; lin_tape multiple paths

Symptom: lstape shows unexpected additional Device suffix numbers in
excess output columns for each additional path of the same
tape/changer driven by the IBM lin_tape device driver
(independent of actual path failover enablement in lin_tape).
It also shows a wrong number of found devices in the header
(without --scsi-only).

lstape prints error about "Unexpected extra argument:" and the
usage for "sg_inq" along with wrong tabular output.

lsluns prints ENOENT error text for "cat" on SCSI device sysfs
attributes hba_id, wwpn, and fcp_lun.

lstape with --verbose option prints ENOENT error text for
"cat" on SCSI device sysfs attributes hba_id and wwpn.

lstape man page: Description of --type and <devbusid> filter
for channel tapes is incomplete. SCSI output description is
incomplete.

lstape shows "N/A" instead of the HBA device bus-ID with
virtio-scsi-ccw.

Problem: s390-tools-1.8.0 before the first upstream commit b627b8d8e1ab
("Initial s390-tools-2.0.0 import") introduced SCSI
tape/changer output for lstape. It used the SCSI device serial
number as lookup key to find a match in IBM lin_tape device
driver proc-fs output for a given SCSI device name. Multiple
paths to the same tape/changer have the same serial number.
Multiple matches cause excess arguments to printf. Explaining
the resulting output, the bash man page says: "The format is
reused as necessary to consume all of the arguments." This
also causes a wrong number of found devices.

The default bash settings have nullglob disabled so if
$SCSI_DEV/scsi_generic* aka
/sys/bus/scsi/devices/*:*:*:*/scsi_generic* does not match
anything, it leaves the glob pattern unmodified and
SG_DEV=$(basename $SG_DEV/*) results in the literal "*". If
$SG_INQ exists, it invoked sg_inq with more than the one
allowed positional argument for a SCSI generic device node
"sg_inq /dev/*". Causing error messages and the usage of
sg_inq to land in $TAPE_SERIAL.

lsluns iterates SCSI generic devices and unconditionally
reads zfcp-specific SCSI device sysfs attributes hba_id, wwpn,
and fcp_lun.

lstape --verbose unconditionally reads zfcp-specific SCSI
device sysfs attributes hba_id and wwpn.

<devbusid> filter missing from synopsis. <device-type> example
at wrong place with <devbusid> filter. <devbusid> filter
option description is a duplicate of <device-type> filter
option description. SCSI output description misses fields.

Lstape only used the zfcp-specific sysfs attribute hba_id.

Solution: Prefer sysfs to find lin_tape device name for SCSI device.
Fallback: The lin_tape proc-fs output format has changed over
the years. The HBA device driver string can contain whitespace
(e.g. "Virtio SCSI HBA") and breaks the field numbers with
tokenized parsing. Grep for the SCSI device name as word (to
skip names with same substring, such as 0:0:1:1 also matching
0:0:1:10) and cut the first field 'Number' (lin_tape device
name suffix). If there is no SCSI column at all [lin_tape
before v2.2.0] (and no SCSI LLDD or other column with a name
accidentally matching a...

Read more...

Revision history for this message
Frank Heimes (fheimes) wrote :

moving comment #1 to bug description

description: updated
Changed in ubuntu-z-systems:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Changed in s390-tools (Ubuntu):
status: New → In Progress
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package s390-tools - 2.6.0-0ubuntu5

---------------
s390-tools (2.6.0-0ubuntu5) cosmic; urgency=medium

  * Cherrypick upstream patches for:
    - lstape, lsluns multiple paths fixes LP: #1790831
    - zkey documentation update
    - zfcpdump incompatible cast fix

 -- Dimitri John Ledkov <email address hidden> Wed, 05 Sep 2018 11:42:43 +0100

Changed in s390-tools (Ubuntu):
status: In Progress → Fix Released
Changed in ubuntu-z-systems:
status: In Progress → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-09-13 09:45 EDT-------
To make it complete it would also make definite sense also having this fixed on 18.04 based on s390-tools 2.3.0 which should be applied cleanly.

Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Fix Released → Triaged
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

this bug does not appear in any of our bug report queries, as it is closed. and it has never been targetted to 18.04. Please either open a new bug with state "new" in launchpad, or make the bugzilla bug bridge re-open the bug on launchpad side by resetting the status to "new".

None of the comments are monitored in launchpad after the bug goes to "fix released" state across all tasks in launchpad.

bugzilla should lock the bug on the bugzilla side as well, whenever LP side goes "fix released".

We need to do something to improve this integration or to change the process we use. As this is not the first time when additional requests are filed post-fix-released, which go beyond the scope of the original bug report. And requests like that fall-through our current process.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Opened bionic task for this bug report in Launchpad.

Revision history for this message
bugproxy (bugproxy) wrote :

------- Comment From <email address hidden> 2018-09-25 09:43 EDT-------
If a LP has the state Fix Released, no addl. requests will be added to a LP entry anymore by IBM. I will then create a new Bugzilla and mirror it to LP having the correct important and scope for the new update....... This should stop the issue we are facing here.. Many thx in advance

tags: added: id-5baa3439bf698b3456cc3621
tags: added: id-5bfbde42072f861b9ffc0fa3
Changed in s390-tools (Ubuntu Bionic):
status: New → In Progress
Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Triaged → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello bugproxy, or anyone else affected,

Accepted s390-tools into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/s390-tools/2.3.0-0ubuntu3.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in s390-tools (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Changed in ubuntu-z-systems:
status: In Progress → Fix Committed
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2019-02-28 08:31 EDT-------
Verified upfront by IBM.

Revision history for this message
Frank Heimes (fheimes) wrote :

Adjusting tags according to comment 9.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package s390-tools - 2.3.0-0ubuntu3.2

---------------
s390-tools (2.3.0-0ubuntu3.2) bionic; urgency=medium

  * lstape, lsluns: handle non-zfcp & lin_tape multiple paths. Many
    cherrypicks from upstream. LP: #1790831
  * lszcrypt: support for alternate zcrypt device drivers. LP: #1800867
  * lsqeth: resolve core dump when called without any eth devices. LP:
    #1813888

 -- Dimitri John Ledkov <email address hidden> Tue, 12 Feb 2019 15:17:08 +0000

Changed in s390-tools (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for s390-tools has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Frank Heimes (fheimes)
Changed in ubuntu-z-systems:
status: Fix Committed → Fix Released
Revision history for this message
bugproxy (bugproxy) wrote : Comment bridged from LTC Bugzilla

------- Comment From <email address hidden> 2019-03-07 07:53 EDT-------
IBM bugzilla status-> closed, Fix released for all required Distros

tags: added: targetmilestone-inin1804
removed: targetmilestone-inin---
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.