Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1738562

[PATCH 3.18 18/42] scsi: zfcp: fix queuecommand for scsi_eh commands when DIX enabled

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 3.18 18/42] scsi: zfcp: fix queuecommand for scsi_eh commands when DIX enabled
Date 2017-09-24 23:40 +0200
Message-ID <utmN4-5vy-9@gated-at.bofh.it> (permalink)
References <utlHj-4Np-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Steffen Maier <maier@linux.vnet.ibm.com>

commit 71b8e45da51a7b64a23378221c0a5868bd79da4f upstream.

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")
Reviewed-by: Benjamin Block <bblock@linux.vnet.ibm.com>
Signed-off-by: Benjamin Block <bblock@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/s390/scsi/zfcp_fsf.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -2247,7 +2247,8 @@ int zfcp_fsf_fcp_cmnd(struct 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,

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.18 00/42] 3.18.72-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 11/42] [PATCH - RESEND] crypto: AF_ALG - remove SGL terminator indicator when  chaining Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 25/42] scsi: sg: use standard lists for sg_requests Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 03/42] Revert "net: phy: Correctly process PHY_HALTED in phy_stop_machine()" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 42/42] mac80211: flush hw_roc_start work before cancelling the ROC Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 05/42] ipv6: fix memory leak with multiple tables during netns destruction Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 27/42] scsi: sg: factor out sg_fill_request_table() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 12/42] ext4: fix incorrect quotaoff if the quota feature is enabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 01/42] ipv6: accept 64k - 1 packet length in ip6_find_1stfragopt() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 21/42] scsi: zfcp: fix payload with full FCP_RSP IU in SCSI trace records Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 29/42] scsi: qla2xxx: Fix an integer overflow in sysfs code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 08/42] [PATCH] Revert "usb: musb: fix tx fifo flush handling again" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 16/42] skd: Avoid that module unloading triggers a use-after-free Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:30 +0200
  [PATCH 3.18 30/42] ftrace: Fix selftest goto location on error Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 07/42] f2fs: check hot_data for roll-forward recovery Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 37/42] bcache: Fix leak of bdev reference Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 40/42] bcache: fix for gc and write-back race Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 39/42] bcache: Correct return value for sysfs attach errors Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 41/42] bcache: fix bch_hprint crash and improve output Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 33/42] PCI: shpchp: Enable bridge bus mastering if MSI is enabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 06/42] ipv6: fix typo in fib6_net_exit() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 31/42] tracing: Apply trace_clock changes to instance max buffer Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 38/42] bcache: correct cache_dirty_target in __update_writeback_rate() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 32/42] ARC: Re-enable MMU upon Machine Check exception Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 28/42] scsi: sg: fixup infoleak when using SG_GET_REQUEST_TABLE Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 34/42] media: v4l2-compat-ioctl32: Fix timespec conversion Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 04/42] tcp: initialize rcv_mss to TCP_MIN_MSS instead of 0 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 35/42] media: uvcvideo: Prevent heap overflow when accessing mapped controls Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 22:40 +0200
  [PATCH 3.18 24/42] scsi: sg: remove save_scat_len Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 23:40 +0200
  [PATCH 3.18 14/42] block: Relax a check in blk_start_queue() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 23:40 +0200
  [PATCH 3.18 18/42] scsi: zfcp: fix queuecommand for scsi_eh commands when DIX enabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 23:40 +0200
  [PATCH 3.18 22/42] scsi: zfcp: trace HBA FSF response by default on dismiss or timedout late response Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 23:40 +0200
  [PATCH 3.18 26/42] scsi: sg: off by one in sg_ioctl() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 23:40 +0200
  [PATCH 3.18 23/42] scsi: zfcp: trace high part of "new" 64 bit SCSI LUN Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 23:40 +0200
  [PATCH 3.18 02/42] qlge: avoid memcpy buffer overflow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 23:40 +0200
  [PATCH 3.18 13/42] powerpc: Fix DAR reporting when alignment handler faults Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-24 23:40 +0200
  Re: [PATCH 3.18 00/42] 3.18.72-stable review Guenter Roeck <linux@roeck-us.net> - 2017-09-25 03:10 +0200
    Re: [PATCH 3.18 00/42] 3.18.72-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-25 08:40 +0200
      Re: [PATCH 3.18 00/42] 3.18.72-stable review Guenter Roeck <linux@roeck-us.net> - 2017-09-25 13:10 +0200
        Re: [PATCH 3.18 00/42] 3.18.72-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-25 14:30 +0200
  Re: [PATCH 3.18 00/42] 3.18.72-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-09-26 01:20 +0200

csiph-web