diff options
author | 2017-05-05 14:17:15 -0500 | |
---|---|---|
committer | 2017-05-05 20:24:43 -0700 | |
commit | 25e78531268e9240fc594ce76587601b873d37c9 (patch) | |
tree | c566a4f7b78f9a23c778741703f3534f1d653116 /drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | |
parent | tcmu: fix module removal due to stuck thread (diff) | |
download | linux-25e78531268e9240fc594ce76587601b873d37c9.tar.gz linux-25e78531268e9240fc594ce76587601b873d37c9.tar.bz2 linux-25e78531268e9240fc594ce76587601b873d37c9.zip |
ibmvscsis: Do not send aborted task response
The driver is sending a response to the actual scsi op that was
aborted by an abort task TM, while LIO is sending a response to
the abort task TM.
ibmvscsis_tgt does not send the response to the client until
release_cmd time. The reason for this was because if we did it
at queue_status time, then the client would be free to reuse the
tag for that command, but we're still using the tag until the
command is released at release_cmd time, so we chose to delay
sending the response until then. That then caused this issue, because
release_cmd is always called, even if queue_status is not.
SCSI spec says that the initiator that sends the abort task
TM NEVER gets a response to the aborted op and with the current
code it will send a response. Thus this fix will remove that response
if the CMD_T_ABORTED && !CMD_T_TAS.
Another case with a small timing window is the case where if LIO sends a
TMR_DOES_NOT_EXIST, and the release_cmd callback is called for the TMR Abort
cmd before the release_cmd for the (attemped) aborted cmd, then we need to
ensure that we send the response for the (attempted) abort cmd to the client
before we send the response for the TMR Abort cmd.
Cc: <stable@vger.kernel.org> # v4.8+
Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Michael Cyr <mikecyr@linux.vnet.ibm.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h')
-rw-r--r-- | drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h index 65c6189885ab..b4391a8de456 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h @@ -168,10 +168,12 @@ struct ibmvscsis_cmd { struct iu_rsp rsp; struct work_struct work; struct scsi_info *adapter; + struct ibmvscsis_cmd *abort_cmd; /* Sense buffer that will be mapped into outgoing status */ unsigned char sense_buf[TRANSPORT_SENSE_BUFFER]; u64 init_time; #define CMD_FAST_FAIL BIT(0) +#define DELAY_SEND BIT(1) u32 flags; char type; }; |