From 33793769937c6fd66202c591c3a2a06b3aa341bd Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 31 Oct 2008 11:16:47 +0000 Subject: [PATCH] - Fixed incorrect SCST state used on error path - Small cleanups - ToDo entry added git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@557 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/ToDo | 3 +++ srpt/src/ib_srpt.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 srpt/ToDo diff --git a/srpt/ToDo b/srpt/ToDo new file mode 100644 index 000000000..681b7c09e --- /dev/null +++ b/srpt/ToDo @@ -0,0 +1,3 @@ +1. SRPT driver directly uses internal states of SCST core target state +machine, which is bad, bad, bad and generally not acceptable. Only dev +handler are allowed to use them. That should be fixed. diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 998fef447..d1fa168d3 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -669,19 +669,18 @@ static void srpt_handle_err_comp(struct srpt_rdma_ch *ch, struct ib_wc *wc) scmnd->sg_cnt = 0; } - if (scmnd->state == SCST_CMD_STATE_RDY_TO_XFER) + if (scmnd->state == SCST_CMD_STATE_DATA_WAIT) scst_rx_data(scmnd, SCST_RX_STATUS_ERROR, SCST_CONTEXT_THREAD); else if (scmnd->state == - SCST_CMD_STATE_XMIT_WAIT) + SCST_CMD_STATE_XMIT_WAIT) scst_tgt_cmd_done(scmnd, SCST_CONTEXT_DIRECT_ATOMIC); } } else srpt_reset_ioctx(ch, ioctx); } - } static void srpt_handle_send_comp(struct srpt_rdma_ch *ch,