Skip to content

Commit 04060db

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: RDMA/isert: Fix a recently introduced regression related to logout
iscsit_close_connection() calls isert_wait_conn(). Due to commit e9d3009 both functions call target_wait_for_sess_cmds() although that last function should be called only once. Fix this by removing the target_wait_for_sess_cmds() call from isert_wait_conn() and by only calling isert_wait_conn() after target_wait_for_sess_cmds(). Fixes: e9d3009 ("scsi: target: iscsi: Wait for all commands to finish before freeing a session"). Link: https://lore.kernel.org/r/[email protected] Reported-by: Rahul Kundu <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Tested-by: Mike Marciniszyn <[email protected]> Acked-by: Sagi Grimberg <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 0e22096 commit 04060db

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

drivers/infiniband/ulp/isert/ib_isert.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2575,17 +2575,6 @@ isert_wait4logout(struct isert_conn *isert_conn)
25752575
}
25762576
}
25772577

2578-
static void
2579-
isert_wait4cmds(struct iscsi_conn *conn)
2580-
{
2581-
isert_info("iscsi_conn %p\n", conn);
2582-
2583-
if (conn->sess) {
2584-
target_sess_cmd_list_set_waiting(conn->sess->se_sess);
2585-
target_wait_for_sess_cmds(conn->sess->se_sess);
2586-
}
2587-
}
2588-
25892578
/**
25902579
* isert_put_unsol_pending_cmds() - Drop commands waiting for
25912580
* unsolicitate dataout
@@ -2633,7 +2622,6 @@ static void isert_wait_conn(struct iscsi_conn *conn)
26332622

26342623
ib_drain_qp(isert_conn->qp);
26352624
isert_put_unsol_pending_cmds(conn);
2636-
isert_wait4cmds(conn);
26372625
isert_wait4logout(isert_conn);
26382626

26392627
queue_work(isert_release_wq, &isert_conn->release_work);

drivers/target/iscsi/iscsi_target.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4149,9 +4149,6 @@ int iscsit_close_connection(
41494149
iscsit_stop_nopin_response_timer(conn);
41504150
iscsit_stop_nopin_timer(conn);
41514151

4152-
if (conn->conn_transport->iscsit_wait_conn)
4153-
conn->conn_transport->iscsit_wait_conn(conn);
4154-
41554152
/*
41564153
* During Connection recovery drop unacknowledged out of order
41574154
* commands for this connection, and prepare the other commands
@@ -4237,6 +4234,9 @@ int iscsit_close_connection(
42374234
target_sess_cmd_list_set_waiting(sess->se_sess);
42384235
target_wait_for_sess_cmds(sess->se_sess);
42394236

4237+
if (conn->conn_transport->iscsit_wait_conn)
4238+
conn->conn_transport->iscsit_wait_conn(conn);
4239+
42404240
ahash_request_free(conn->conn_tx_hash);
42414241
if (conn->conn_rx_hash) {
42424242
struct crypto_ahash *tfm;

0 commit comments

Comments
 (0)