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,