From fa5aab6390716a5ca5db532ede1f33af173af3d6 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 26 Mar 2014 11:58:25 +0000 Subject: [PATCH] ib_srpt: Clean up srpt_handle_rdma_err_comp() This patch does not change any functionality. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5391 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 7191242bd..ee4ae232c 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1506,11 +1506,9 @@ static void srpt_handle_rdma_err_comp(struct srpt_rdma_ch *ch, enum srpt_opcode opcode, enum scst_exec_context context) { - struct scst_cmd *scmnd; - enum srpt_command_state state; + struct scst_cmd *scmnd = &ioctx->scmnd; + enum srpt_command_state state = ioctx->state; - scmnd = &ioctx->scmnd; - state = ioctx->state; switch (opcode) { case SRPT_RDMA_READ_LAST: if (ioctx->n_rdma <= 0) { @@ -1527,6 +1525,12 @@ static void srpt_handle_rdma_err_comp(struct srpt_rdma_ch *ch, __LINE__, state); break; case SRPT_RDMA_WRITE_LAST: + /* + * Note: if an RDMA write error completion is received that + * means that a SEND has also been posted. Defer further + * processing of the associated command until the send error + * completion has been received. + */ scst_set_delivery_status(scmnd, SCST_CMD_DELIVERY_ABORTED); break; default: