]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
IB/srpt: Fix abort handling
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 4 May 2017 22:50:53 +0000 (15:50 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 7 May 2017 23:11:09 +0000 (16:11 -0700)
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 <bart.vanassche@sandisk.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Doug Ledford <dledford@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: David Disseldorp <ddiss@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/infiniband/ulp/srpt/ib_srpt.c

index 7e314c2f207162f51b8c1ab78c6f0367b9025321..36d15da7a395bc4138a94da291119deb035700b7 100644 (file)
@@ -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 &&