ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
62 stars 58 forks source link

lszfcp -D fails due to missing attributes in sysfs #123

Closed jstodola closed 2 years ago

jstodola commented 2 years ago

Description of problem: lszfcp cannot display information about attached zFCP SCSI devices:

[root@rtt2 ~]# cio_ignore -r a002
[root@rtt2 ~]# chccwdev -e a002
Setting device 0.0.a002 online
Done
[root@rtt2 ~]# lszfcp -D
/usr/sbin/lszfcp: line 390: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-0/target0:0:0/0:0:0:0//hba_id: No such file or directory
/usr/sbin/lszfcp: line 391: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-0/target0:0:0/0:0:0:0//wwpn: No such file or directory
/usr/sbin/lszfcp: line 392: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-0/target0:0:0/0:0:0:0//fcp_lun: No such file or directory
/usr/sbin/lszfcp: line 390: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-1/target0:0:1/0:0:1:0//hba_id: No such file or directory
/usr/sbin/lszfcp: line 391: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-1/target0:0:1/0:0:1:0//wwpn: No such file or directory
/usr/sbin/lszfcp: line 392: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-1/target0:0:1/0:0:1:0//fcp_lun: No such file or directory
/usr/sbin/lszfcp: line 390: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-2/target0:0:2/0:0:2:0//hba_id: No such file or directory
/usr/sbin/lszfcp: line 391: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-2/target0:0:2/0:0:2:0//wwpn: No such file or directory
/usr/sbin/lszfcp: line 392: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-2/target0:0:2/0:0:2:0//fcp_lun: No such file or directory
/usr/sbin/lszfcp: line 390: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-3/target0:0:3/0:0:3:0//hba_id: No such file or directory
/usr/sbin/lszfcp: line 391: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-3/target0:0:3/0:0:3:0//wwpn: No such file or directory
/usr/sbin/lszfcp: line 392: /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-3/target0:0:3/0:0:3:0//fcp_lun: No such file or directory
[root@rtt2 ~]# ls /sys/bus/ccw/drivers/zfcp/0.0.a002/host0/rport-0:0-0/target0:0:0/0:0:0:0/
blacklist       evt_capacity_change_reported        iodone_cnt            rev           uevent
block           evt_inquiry_change_reported         ioerr_cnt             scsi_device   vendor
bsg             evt_lun_change_reported             iorequest_cnt         scsi_disk     vpd_pg0
delete          evt_media_change                    modalias              scsi_generic  vpd_pg80
device_blocked  evt_mode_parameter_change_reported  model                 scsi_level    vpd_pg83
device_busy     evt_soft_threshold_reached          queue_depth           state         wwid
dh_state        generic                             queue_ramp_up_period  subsystem
driver          inquiry                             queue_type            timeout
eh_timeout      iocounterbits                       rescan                type
[root@rtt2 ~]# rpm -qf /usr/sbin/lszfcp 
s390utils-base-2.18.0-2.fc36.s390x
[root@rtt2 ~]# uname -r
5.16.0-0.rc0.20211112git5833291ab6de.12.fc36.s390x
[root@rtt2 ~]#

lszdev shows the devices correctly:

[root@rtt2 ~]# lszdev | grep 0.0.a002
zfcp-host    0.0.a002                                        yes  no    
zfcp-lun     0.0.a002:0x500507680d751cc1:0x0000000000000000  yes  no    sdb sg1
zfcp-lun     0.0.a002:0x500507680d751cc2:0x0000000000000000  yes  no    sdc sg2
zfcp-lun     0.0.a002:0x500507680d7d1cc1:0x0000000000000000  yes  no    sda sg0
zfcp-lun     0.0.a002:0x500507680d7d1cc2:0x0000000000000000  yes  no    sdd sg3
[root@rtt2 ~]#

Version-Release number of selected component (if applicable): s390utils-base-2.18.0-2.fc36 kernel-5.16.0-0.rc0.20211112git5833291ab6de.12.fc36

How reproducible: always

Additional info: [1] says: "The zfcp-specific sysfs attributes hba_id, wwpn, and fcp_lun are deprecated. Use the methods described here instead to find the addressing of a SCSI device."

[1] https://www.ibm.com/docs/en/linux-on-systems?topic=devices-mapping-sysfs-representations

(Copy of Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=2023108)

sharkcz commented 2 years ago
Benjamin-Block commented 2 years ago

@steffen-maier is already working on it. This is a regression in 5.16, we tried to get it fixed before rc1, but missed the window. IIRC should be fixed once rc1 gets released.

https://lore.kernel.org/linux-scsi/7c0af228-e098-5657-934e-d2bd2bff5ee3@linux.ibm.com/ https://lore.kernel.org/linux-scsi/20211026014240.4098365-1-maier@linux.ibm.com/ https://lore.kernel.org/linux-scsi/f5900f54-dddd-6dd4-ce13-a8bdfa58b6ad@linux.ibm.com/

The tool is fine, there was a change in the SCSI common code as to when and how sysfs attributes get initialized, and especially how driver-specific attributes get attached. Once the fix is in, everything should work as before.

jstodola commented 2 years ago

OK, thanks for the explanation. I'm closing this issue, since this is a problem in kernel.