Patch "scsi: zfcp: fix capping of unsuccessful GPN_FT SAN response trace records" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
scsi: zfcp: fix capping of unsuccessful GPN_FT SAN response trace records
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
scsi-zfcp-fix-capping-of-unsuccessful-gpn_ft-san-response-trace-records.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
975171b4461be296a35e83ebd748946b81cf0635Mon Sep 17 00:00:00 2001
From: Steffen Maier <[email protected]>
Date: Fri, 28 Jul 2017 12:30:53 +0200
Subject: scsi: zfcp: fix capping of unsuccessful GPN_FT SAN response trace records
From: Steffen Maier <[email protected]>
commit 975171b4461be296a35e83ebd748946b81cf0635 upstream.
v4.9 commit aceeffbb59bb ("zfcp: trace full payload of all SAN records (req,resp,iels)") fixed trace data loss of 2.6.38 commit 2c55b750a884 ("[SCSI] zfcp: Redesign of the debug tracing for SAN records.") necessary for problem determination, e.g. to see the currently active zone set during automatic port scan.
While it already saves space by not dumping any empty residual entries of the large successful GPN_FT response (4 pages), there are seldom cases where the GPN_FT response is unsuccessful and likely does not have FC_NS_FID_LAST set in fp_flags so we did not cap the trace record. We typically see such case for an initiator WWPN, which is not in any zone.
Cap unsuccessful responses to at least the actual basic CT_IU response plus whatever fits the SAN trace record built-in "payload" buffer just in case there's trailing information
of which we would at least see the existence and its beginning.
In order not to erroneously cap successful responses, we need to swap calling the trace function and setting the CT / ELS status to success (0).
Example trace record pair formatted with zfcpdbf:
Timestamp : ...
Area : SAN
Subarea : 00
Level : 1
Exception : -
CPU ID : ..
Caller : 0x...
Record ID : 1
Tag : fssct_1
Request ID : 0x<request_id>
Destination ID : 0x00fffffc
SAN req short : 01000000 fc020000 01720ffc 00000000
00000008
SAN req length : 20
|
Timestamp : ...
Area : SAN
Subarea : 00
Level : 1
Exception : -
CPU ID : ..
Caller : 0x...
Record ID : 2
Tag : fsscth2
Request ID : 0x<request_id>
Destination ID : 0x00fffffc
SAN resp short : 01000000 fc020000 80010000 00090700
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
SAN resp length: 16384
San resp info : 01000000 fc020000 80010000 00090700
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]
00000000 00000000 00000000 00000000 [trailing info]The fix saves all but one of the previously associated 64 PAYload trace record chunks of size 256 bytes each.
--- drivers/s390/scsi/zfcp_dbf.c | 10 +++++++++- drivers/s390/scsi/zfcp_fsf.c | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-)
drivers/s390/scsi/zfcp_dbf.c +9 -1
@@ -3,7 +3,7 @@* * Debug traces for zfcp. * -* Copyright IBM Corp. 2002, 2016 +* Copyright IBM Corp. 2002, 2017 */ #define KMSG_COMPONENT "zfcp"
@@ -447,6 +447,7 @@ static u16 zfcp_dbf_san_res_cap_len_if_gstruct fc_ct_hdr *reqh =sg_virt (ct_els->req);struct fc_ns_gid_ft *reqn = (struct fc_ns_gid_ft *)(reqh +1 );struct scatterlist *resp_entry = ct_els->resp; +struct fc_ct_hdr *resph;struct fc_gpn_ft_resp *acc;int max_entries, x, last =0 ;
@@ -473,6 +474,13 @@ static u16 zfcp_dbf_san_res_cap_len_if_greturn len;/* not GPN_FT response so do not cap */ acc =sg_virt (resp_entry); + +/* cap all but accept CT responses to at least the CT header */ + resph = (struct fc_ct_hdr *)acc; +if ((ct_els->status) || + (resph->ct_cmd !=cpu_to_be16 (FC_FS_ACC ))) +return max (FC_CT_HDR_LEN ,ZFCP_DBF_SAN_MAX_PAYLOAD ); + max_entries = (reqh->ct_mr_size *4 /sizeof (struct fc_gpn_ft_resp )) +1 /* zfcp_fc_scan_ports: bytes correct, entries off-by-one * to account for header as 1st pseudo "entry" */ ;
drivers/s390/scsi/zfcp_fsf.c +2 -2
@@ -928,8 +928,8 @@ static void zfcp_fsf_send_ct_handler(strswitch (header->fsf_status) {case FSF_GOOD : -zfcp_dbf_san_res ("fsscth2" , req); ct->status =0 ; +zfcp_dbf_san_res ("fsscth2" , req);break ;case FSF_SERVICE_CLASS_NOT_SUPPORTED :zfcp_fsf_class_not_supp (req);
@@ -1109,8 +1109,8 @@ static void zfcp_fsf_send_els_handler(stswitch (header->fsf_status) {case FSF_GOOD : -zfcp_dbf_san_res ("fsselh1" , req); send_els->status =0 ; +zfcp_dbf_san_res ("fsselh1" , req);break ;case FSF_SERVICE_CLASS_NOT_SUPPORTED :zfcp_fsf_class_not_supp (req);
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/scsi-zfcp-add-handling-for-fcp_resid_over-to-the-fcp-ingress-path.patch queue-4.4/scsi-zfcp-trace-high-part-of-new-64-bit-scsi-lun.patch queue-4.4/scsi-zfcp-fix-queuecommand-for-scsi_eh-commands-when-dix-enabled.patch queue-4.4/scsi-zfcp-fix-payload-with-full-fcp_rsp-iu-in-scsi-trace-records.patch queue-4.4/scsi-zfcp-fix-capping-of-unsuccessful-gpn_ft-san-response-trace-records.patch queue-4.4/scsi-zfcp-trace-hba-fsf-response-by-default-on-dismiss-or-timedout-late-response.patch queue-4.4/scsi-zfcp-fix-passing-fsf_req-to-scsi-trace-on-tmf-to-correlate-with-hba.patch queue-4.4/scsi-zfcp-fix-missing-trace-records-for-early-returns-in-tmf-eh-handlers.patch