mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
IB/srpt: Fix abort handling
Let the target core check the CMD_T_ABORTED flag instead of the SRP target driver. Hence remove the transport_check_aborted_status() call. Since state == SRPT_STATE_CMD_RSP_SENT is something that really should not happen, do not try to recover if srpt_queue_response() is called for an I/O context that is in that state. This patch is a bug fix because the srpt_abort_cmd() call is misplaced - if that function is called from srpt_queue_response() it should either be called before the command state is changed or after the response has been sent. Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Cc: Doug Ledford <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Andy Grover <[email protected]> Cc: David Disseldorp <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
parent
59ac9c0781
commit
55d694275f
1 changed files with 1 additions and 5 deletions
|
|
@ -2302,12 +2302,8 @@ static void srpt_queue_response(struct se_cmd *cmd)
|
|||
}
|
||||
spin_unlock_irqrestore(&ioctx->spinlock, flags);
|
||||
|
||||
if (unlikely(transport_check_aborted_status(&ioctx->cmd, false)
|
||||
|| WARN_ON_ONCE(state == SRPT_STATE_CMD_RSP_SENT))) {
|
||||
atomic_inc(&ch->req_lim_delta);
|
||||
srpt_abort_cmd(ioctx);
|
||||
if (unlikely(WARN_ON_ONCE(state == SRPT_STATE_CMD_RSP_SENT)))
|
||||
return;
|
||||
}
|
||||
|
||||
/* For read commands, transfer the data to the initiator. */
|
||||
if (ioctx->cmd.data_direction == DMA_FROM_DEVICE &&
|
||||
|
|
|
|||
Loading…
Reference in a new issue