isert: add assertion if send/recv was posted after post drain

After post drain we are not allowed to call post_recv or post_send,
because the drain must be the last flush to let us know that we may
close the conection safely.

Signed-off-by: Israel Rukshin <israelr@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6943 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Israel Rukshin
2016-08-17 07:27:43 +00:00
parent b235efb8d2
commit 854a7a060d

View File

@@ -75,6 +75,13 @@ int isert_post_recv(struct isert_connection *isert_conn,
TRACE_ENTRY();
#ifdef CONFIG_SCST_EXTRACHECKS
if (test_bit(ISERT_DRAIN_POSTED, &isert_conn->flags)) {
pr_err("conn:%p post recv after drain\n", isert_conn);
BUG();
}
#endif
err = ib_post_recv(isert_conn->qp, first_ib_wr, &bad_wr);
if (unlikely(err)) {
num_posted = isert_num_recv_posted_on_err(first_ib_wr, bad_wr);
@@ -115,6 +122,13 @@ int isert_post_send(struct isert_connection *isert_conn,
TRACE_ENTRY();
#ifdef CONFIG_SCST_EXTRACHECKS
if (test_bit(ISERT_DRAIN_POSTED, &isert_conn->flags)) {
pr_err("conn:%p post send after drain\n", isert_conn);
BUG();
}
#endif
err = ib_post_send(isert_conn->qp, first_ib_wr, &bad_wr);
if (unlikely(err)) {
num_posted = isert_num_send_posted_on_err(first_ib_wr, bad_wr);