From 854a7a060ddc4829080e3cd7edfe658eb2e9a377 Mon Sep 17 00:00:00 2001 From: Israel Rukshin Date: Wed, 17 Aug 2016 07:27:43 +0000 Subject: [PATCH] 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 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6943 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_rdma.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 48cb109f8..2e1cf989a 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -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);