From 28c5d73550d4e24311b7d22bb76dd84a04fe3d3e Mon Sep 17 00:00:00 2001 From: Israel Rukshin Date: Sun, 14 May 2017 13:45:02 +0000 Subject: [PATCH] isert-scst: fix isert connection teardown flow Synchronizing the rdma_disconnect() with the post drain wr as other ULPs like iSER do. Signed-off-by: Israel Rukshin git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7181 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_rdma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 192494545..f38207573 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -198,8 +198,11 @@ static void isert_post_drain_rq(struct isert_connection *isert_conn) void isert_post_drain(struct isert_connection *isert_conn) { if (!test_and_set_bit(ISERT_DRAIN_POSTED, &isert_conn->flags)) { + mutex_lock(&isert_conn->state_mutex); + isert_conn->state = ISER_CONN_CLOSING; isert_post_drain_rq(isert_conn); isert_post_drain_sq(isert_conn); + mutex_unlock(&isert_conn->state_mutex); } }