Commit c7e160ee authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Nicholas Bellinger

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: default avatarSagi Grimberg <sagig@mellanox.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 36ea63b5
...@@ -1984,13 +1984,6 @@ static void ...@@ -1984,13 +1984,6 @@ static void
isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc) isert_cq_comp_err(struct isert_conn *isert_conn, struct ib_wc *wc)
{ {
if (wc->wr_id == ISER_BEACON_WRID) { 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", pr_info("conn %p completing conn_wait_comp_err\n",
isert_conn); isert_conn);
complete(&isert_conn->conn_wait_comp_err); complete(&isert_conn->conn_wait_comp_err);
...@@ -3242,6 +3235,15 @@ static void isert_release_work(struct work_struct *work) ...@@ -3242,6 +3235,15 @@ static void isert_release_work(struct work_struct *work)
isert_put_conn(isert_conn); isert_put_conn(isert_conn);
} }
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 static void
isert_wait4flush(struct isert_conn *isert_conn) isert_wait4flush(struct isert_conn *isert_conn)
{ {
...@@ -3276,6 +3278,7 @@ static void isert_wait_conn(struct iscsi_conn *conn) ...@@ -3276,6 +3278,7 @@ static void isert_wait_conn(struct iscsi_conn *conn)
isert_conn_terminate(isert_conn); isert_conn_terminate(isert_conn);
mutex_unlock(&isert_conn->conn_mutex); mutex_unlock(&isert_conn->conn_mutex);
isert_wait4cmds(conn);
isert_wait4flush(isert_conn); isert_wait4flush(isert_conn);
INIT_WORK(&isert_conn->release_work, isert_release_work); INIT_WORK(&isert_conn->release_work, isert_release_work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment