ib_srpt: Add a kernel warning

Invoking srpt_zerolength_write() before the queue pair has reached
the error state is a bug, so complain loudly if that happens.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5369 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2014-03-24 12:04:44 +00:00
parent ada7c26a2e
commit b95b1f4d6c
+2
View File
@@ -1936,6 +1936,8 @@ static void srpt_process_send_completion(struct ib_cq *cq,
srpt_handle_rdma_comp(ch, ch->ioctx_ring[index], opcode,
srpt_xmt_rsp_context);
} else if (opcode == SRPT_RDMA_ZEROLENGTH_WRITE) {
WARN_ONCE(true, "%s: QP not in error state\n",
ch->sess_name);
WARN_ON_ONCE(!srpt_set_ch_state(ch, CH_DISCONNECTED));
} else {
WARN(true, "unexpected opcode %d\n", opcode);