From ef830f9335c79e649abb2cc4f33f386c9dd88772 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 10 Apr 2015 17:18:22 +0000 Subject: [PATCH] ib_srpt: Avoid that aborting a command triggers a race condition (merge r6181 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@6182 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index c6a27f4c4..f2b885af3 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1366,36 +1366,6 @@ static void srpt_abort_cmd(struct srpt_send_ioctx *ioctx, TRACE_EXIT(); } -static void srpt_on_abort_cmd(struct scst_cmd *cmd) -{ - struct srpt_send_ioctx *ioctx = scst_cmd_get_tgt_priv(cmd); - struct srpt_rdma_ch *ch = ioctx->ch; - - if (ch->state >= CH_DISCONNECTED) { - switch (ioctx->state) { - case SRPT_STATE_NEW: - case SRPT_STATE_DATA_IN: - case SRPT_STATE_MGMT: - case SRPT_STATE_DONE: - /* - * An SCST command thread is busy processing the - * command associated with the I/O context, so wait - * until that processing has finished. - */ - break; - case SRPT_STATE_NEED_DATA: - case SRPT_STATE_CMD_RSP_SENT: - case SRPT_STATE_MGMT_RSP_SENT: - PRINT_ERROR("Cmd %p: IB completion for idx %u has not" - " been received in time (SRPT command state" - " %d)", cmd, ioctx->ioctx.index, - ioctx->state); - srpt_abort_cmd(ioctx, SCST_CONTEXT_THREAD); - break; - } - } -} - /** * srpt_handle_send_err_comp() - Process an IB_WC_SEND error completion. */ @@ -3945,7 +3915,6 @@ static struct scst_tgt_template srpt_template = { .close_session = srpt_close_session, .xmit_response = srpt_xmit_response, .rdy_to_xfer = srpt_rdy_to_xfer, - .on_abort_cmd = srpt_on_abort_cmd, .on_hw_pending_cmd_timeout = srpt_pending_cmd_timeout, .on_free_cmd = srpt_on_free_cmd, .task_mgmt_fn_done = srpt_tsk_mgmt_done,