From: Benjamin Block <bblock@linux.vnet.ibm.com>
To: "James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Steffen Maier <maier@linux.vnet.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
stable@vger.kernel.org,
Benjamin Block <bblock@linux.vnet.ibm.com>
Subject: [PATCH 05/22] zfcp: fix queuecommand for scsi_eh commands when DIX enabled
Date: Fri, 28 Jul 2017 12:30:51 +0200 [thread overview]
Message-ID: <9ef47a2f823cf6010b28fd2bf0b235311aaeb996.1501085249.git.bblock@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1501085249.git.bblock@linux.vnet.ibm.com>
In-Reply-To: <cover.1501085249.git.bblock@linux.vnet.ibm.com>
From: Steffen Maier <maier@linux.vnet.ibm.com>
Since commit db007fc5e20c ("[SCSI] Command protection operation"),
scsi_eh_prep_cmnd() saves scmd->prot_op and temporarily resets it to
SCSI_PROT_NORMAL.
Other FCP LLDDs such as qla2xxx and lpfc shield their queuecommand()
to only access any of scsi_prot_sg...() if
(scsi_get_prot_op(cmd) != SCSI_PROT_NORMAL).
Do the same thing for zfcp, which introduced DIX support with
commit ef3eb71d8ba4 ("[SCSI] zfcp: Introduce experimental support for
DIF/DIX").
Otherwise, TUR SCSI commands as part of scsi_eh likely fail in zfcp,
because the regular SCSI command with DIX protection data, that scsi_eh
re-uses in scsi_send_eh_cmnd(), of course still has
(scsi_prot_sg_count() != 0) and so zfcp sends down bogus requests to the
FCP channel hardware.
This causes scsi_eh_test_devices() to have (finish_cmds == 0)
[not SCSI device is online or not scsi_eh_tur() failed]
so regular SCSI commands, that caused / were affected by scsi_eh,
are moved to work_q and scsi_eh_test_devices() itself returns false.
In turn, it unnecessarily escalates in our case in scsi_eh_ready_devs()
beyond host reset to finally scsi_eh_offline_sdevs()
which sets affected SCSI devices offline with the following kernel message:
"kernel: sd H:0:T:L: Device offlined - not ready after error recovery"
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Fixes: ef3eb71d8ba4 ("[SCSI] zfcp: Introduce experimental support for DIF/DIX")
Cc: <stable@vger.kernel.org> #2.6.36+
Reviewed-by: Benjamin Block <bblock@linux.vnet.ibm.com>
Signed-off-by: Benjamin Block <bblock@linux.vnet.ibm.com>
---
drivers/s390/scsi/zfcp_fsf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 3b69ec5e69ed..e894ec92076c 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -2257,7 +2257,8 @@ int zfcp_fsf_fcp_cmnd(struct scsi_cmnd *scsi_cmnd)
fcp_cmnd = (struct fcp_cmnd *) &req->qtcb->bottom.io.fcp_cmnd;
zfcp_fc_scsi_to_fcp(fcp_cmnd, scsi_cmnd, 0);
- if (scsi_prot_sg_count(scsi_cmnd)) {
+ if ((scsi_get_prot_op(scsi_cmnd) != SCSI_PROT_NORMAL) &&
+ scsi_prot_sg_count(scsi_cmnd)) {
zfcp_qdio_set_data_div(qdio, &req->qdio_req,
scsi_prot_sg_count(scsi_cmnd));
retval = zfcp_qdio_sbals_from_sg(qdio, &req->qdio_req,
--
2.11.2
next prev parent reply other threads:[~2017-07-28 10:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-28 10:30 [PATCH 00/22] zfcp fixes and cleanups Benjamin Block
2017-07-28 10:30 ` [PATCH 01/22] zfcp: replace zfcp_qdio_sbale_count by sg_nents Benjamin Block
2017-07-28 10:30 ` [PATCH 02/22] zfcp: use setup_timer instead of init_timer Benjamin Block
2017-07-28 10:30 ` [PATCH 03/22] zfcp: Remove unneeded linux/miscdevice.h include Benjamin Block
2017-07-28 10:30 ` [PATCH 04/22] zfcp: convert bool-definitions to use 'true' instead of '1' Benjamin Block
2017-07-28 10:30 ` Benjamin Block [this message]
2017-07-28 10:30 ` [PATCH 06/22] zfcp: add handling for FCP_RESID_OVER to the fcp ingress path Benjamin Block
2017-07-28 10:30 ` [PATCH 07/22] zfcp: fix capping of unsuccessful GPN_FT SAN response trace records Benjamin Block
2017-07-28 10:30 ` [PATCH 08/22] zfcp: fix passing fsf_req to SCSI trace on TMF to correlate with HBA Benjamin Block
2017-07-28 10:30 ` [PATCH 09/22] zfcp: fix missing trace records for early returns in TMF eh handlers Benjamin Block
2017-07-28 10:30 ` [PATCH 10/22] zfcp: fix payload with full FCP_RSP IU in SCSI trace records Benjamin Block
2017-07-28 10:30 ` [PATCH 11/22] zfcp: trace HBA FSF response by default on dismiss or timedout late response Benjamin Block
2017-07-28 10:30 ` [PATCH 12/22] zfcp: trace high part of "new" 64 bit SCSI LUN Benjamin Block
2017-07-28 10:30 ` [PATCH 13/22] zfcp: more fitting constant for fc_ct_hdr.ct_reason on port scan response Benjamin Block
2017-07-28 10:31 ` [PATCH 14/22] zfcp: clarify that we don't need "link" test on failed open port Benjamin Block
2017-07-28 10:31 ` [PATCH 15/22] zfcp: use common code fcp_cmnd and fcp_resp with union in fsf_qtcb_bottom_io Benjamin Block
2017-07-28 10:31 ` [PATCH 16/22] zfcp: use endianness conversions with common FC(P) struct fields Benjamin Block
2017-07-28 10:31 ` [PATCH 17/22] zfcp: fix kernel doc comment typos for struct zfcp_dbf_scsi Benjamin Block
2017-07-28 10:31 ` [PATCH 18/22] zfcp: clean up redundant code with fall through in link down SRB switch case Benjamin Block
2017-07-28 10:31 ` [PATCH 19/22] zfcp: clean up no longer existent prototype from zfcp API header Benjamin Block
2017-07-28 10:31 ` [PATCH 20/22] zfcp: clean up a member of struct zfcp_qdio that was assigned but never used Benjamin Block
2017-07-28 10:31 ` [PATCH 21/22] zfcp: clean up unnecessary module_param_named() with no_auto_port_rescan Benjamin Block
2017-07-28 10:31 ` [PATCH 22/22] zfcp: early returns for traces disabled via level Benjamin Block
2017-08-07 17:19 ` [PATCH 00/22] zfcp fixes and cleanups Martin K. Petersen
2017-08-08 10:02 ` Benjamin Block
2017-08-08 16:07 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9ef47a2f823cf6010b28fd2bf0b235311aaeb996.1501085249.git.bblock@linux.vnet.ibm.com \
--to=bblock@linux.vnet.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=maier@linux.vnet.ibm.com \
--cc=martin.petersen@oracle.com \
--cc=schwidefsky@de.ibm.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox