linux-stable/drivers/s390/scsi
Steffen Maier 96d9270499 scsi: zfcp: fix missing REC trigger trace on terminate_rport_io early return
get_device() and its internally used kobject_get() only return NULL if they
get passed NULL as argument. zfcp_get_port_by_wwpn() loops over
adapter->port_list so the iteration variable port is always non-NULL.
Struct device is embedded in struct zfcp_port so &port->dev is always
non-NULL. This is the argument to get_device().  However, if we get an
fc_rport in terminate_rport_io() for which we cannot find a match within
zfcp_get_port_by_wwpn(), the latter can return NULL.  v2.6.30 commit
70932935b6 ("[SCSI] zfcp: Fix oops when port disappears") introduced an
early return without adding a trace record for this case.  Even if we don't
need recovery in this case, for debugging we should still see that our
callback was invoked originally by scsi_transport_fc.

Example trace record formatted with zfcpdbf from s390-tools:

Timestamp      : ...
Area           : REC
Subarea        : 00
Level          : 1
Exception      : -
CPU ID         : ..
Caller         : 0x...
Record ID      : 1
Tag            : sctrpin        SCSI terminate rport I/O, no zfcp port
LUN            : 0xffffffffffffffff                     none (invalid)
WWPN           : 0x<wwpn>               WWPN
D_ID           : 0x<n_port_id>          N_Port-ID
Adapter status : 0x...
Port status    : 0xffffffff             unknown (-1)
LUN status     : 0x00000000                             none (invalid)
Ready count    : 0x...
Running count  : 0x...
ERP want       : 0x03                   ZFCP_ERP_ACTION_REOPEN_PORT_FORCED
ERP need       : 0xc0                   ZFCP_ERP_ACTION_NONE

Signed-off-by: Steffen Maier <maier@linux.ibm.com>
Fixes: 70932935b6 ("[SCSI] zfcp: Fix oops when port disappears")
Cc: <stable@vger.kernel.org> #2.6.38+
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-05-18 11:22:10 -04:00
..
Makefile s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00
zfcp_aux.c s390: scsi: zfcp_aux: add SPDX identifier 2017-11-24 14:28:44 +01:00
zfcp_ccw.c
zfcp_dbf.c scsi: zfcp: fix missing SCSI trace for result of eh_host_reset_handler 2018-05-18 11:22:10 -04:00
zfcp_dbf.h
zfcp_def.h
zfcp_erp.c scsi: zfcp: fix missing REC trigger trace on terminate_rport_io early return 2018-05-18 11:22:10 -04:00
zfcp_ext.h scsi: zfcp: fix missing REC trigger trace on terminate_rport_io early return 2018-05-18 11:22:10 -04:00
zfcp_fc.c bsg-lib: introduce a timeout field in struct bsg_job 2018-03-13 11:40:21 -06:00
zfcp_fc.h
zfcp_fsf.c treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts 2017-11-21 16:35:54 -08:00
zfcp_fsf.h
zfcp_qdio.c
zfcp_qdio.h
zfcp_reqlist.h
zfcp_scsi.c scsi: zfcp: fix missing REC trigger trace on terminate_rport_io early return 2018-05-18 11:22:10 -04:00
zfcp_sysfs.c
zfcp_unit.c