summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-12-02 16:57:46 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2014-12-12 23:32:32 -0800
commitc7e160ee092059d3d1ddc24397c9d7a4dbe8186a (patch)
treedf6283a898f01e6c7a225fb73509134cf61c534a /drivers/infiniband/ulp
parent36ea63b523f3f3b57f708f14af848cac100677d5 (diff)
downloadlinux-c7e160ee092059d3d1ddc24397c9d7a4dbe8186a.tar.gz
linux-c7e160ee092059d3d1ddc24397c9d7a4dbe8186a.tar.bz2
linux-c7e160ee092059d3d1ddc24397c9d7a4dbe8186a.zip
iser-target: Don't wait for session commands from completion context
Might result in a deadlock where completion context waits for session commands release where the later might need a final completion for it. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r--drivers/infiniband/ulp/isert/ib_isert.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 276054b65b98..fc4641e5fd1e 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -1984,13 +1984,6 @@ static void
isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc)
{
if (wc->wr_id == ISER_BEACON_WRID) {
- struct iscsi_conn *conn = isert_conn->conn;
-
- if (conn->sess) {
- target_sess_cmd_list_set_waiting(conn->sess->se_sess);
- target_wait_for_sess_cmds(conn->sess->se_sess);
- }
-
pr_info("conn %p completing conn_wait_comp_err\n",
isert_conn);
complete(&isert_conn->conn_wait_comp_err);
@@ -3243,6 +3236,15 @@ static void isert_release_work(struct work_struct *work)
}
static void
+isert_wait4cmds(struct iscsi_conn *conn)
+{
+ if (conn->sess) {
+ target_sess_cmd_list_set_waiting(conn->sess->se_sess);
+ target_wait_for_sess_cmds(conn->sess->se_sess);
+ }
+}
+
+static void
isert_wait4flush(struct isert_conn *isert_conn)
{
struct ib_recv_wr *bad_wr;
@@ -3276,6 +3278,7 @@ static void isert_wait_conn(struct iscsi_conn *conn)
isert_conn_terminate(isert_conn);
mutex_unlock(&isert_conn->conn_mutex);
+ isert_wait4cmds(conn);
isert_wait4flush(isert_conn);
INIT_WORK(&isert_conn->release_work, isert_release_work);