Skip to content

Commit 807b951

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: Revert "target: iscsi: Wait for all commands to finish before freeing a session"
Since commit e9d3009 introduced a regression and since the fix for that regression was not perfect, revert this commit. Link: https://marc.info/?l=target-devel&m=158157054906195 Cc: Rahul Kundu <[email protected]> Cc: Mike Marciniszyn <[email protected]> Cc: Sagi Grimberg <[email protected]> Reported-by: Dakshaja Uppalapati <[email protected]> Fixes: e9d3009 ("scsi: target: iscsi: Wait for all commands to finish before freeing a session") Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 76261ad commit 807b951

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

drivers/target/iscsi/iscsi_target.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,9 +1165,7 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
11651165
hdr->cmdsn, be32_to_cpu(hdr->data_length), payload_length,
11661166
conn->cid);
11671167

1168-
if (target_get_sess_cmd(&cmd->se_cmd, true) < 0)
1169-
return iscsit_add_reject_cmd(cmd,
1170-
ISCSI_REASON_WAITING_FOR_LOGOUT, buf);
1168+
target_get_sess_cmd(&cmd->se_cmd, true);
11711169

11721170
cmd->sense_reason = transport_lookup_cmd_lun(&cmd->se_cmd,
11731171
scsilun_to_int(&hdr->lun));
@@ -2004,9 +2002,7 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
20042002
conn->sess->se_sess, 0, DMA_NONE,
20052003
TCM_SIMPLE_TAG, cmd->sense_buffer + 2);
20062004

2007-
if (target_get_sess_cmd(&cmd->se_cmd, true) < 0)
2008-
return iscsit_add_reject_cmd(cmd,
2009-
ISCSI_REASON_WAITING_FOR_LOGOUT, buf);
2005+
target_get_sess_cmd(&cmd->se_cmd, true);
20102006

20112007
/*
20122008
* TASK_REASSIGN for ERL=2 / connection stays inside of
@@ -4234,8 +4230,6 @@ int iscsit_close_connection(
42344230
* must wait until they have completed.
42354231
*/
42364232
iscsit_check_conn_usage_count(conn);
4237-
target_sess_cmd_list_set_waiting(sess->se_sess);
4238-
target_wait_for_sess_cmds(sess->se_sess);
42394233

42404234
ahash_request_free(conn->conn_tx_hash);
42414235
if (conn->conn_rx_hash) {

include/scsi/iscsi_proto.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,6 @@ struct iscsi_reject {
627627
#define ISCSI_REASON_BOOKMARK_INVALID 9
628628
#define ISCSI_REASON_BOOKMARK_NO_RESOURCES 10
629629
#define ISCSI_REASON_NEGOTIATION_RESET 11
630-
#define ISCSI_REASON_WAITING_FOR_LOGOUT 12
631630

632631
/* Max. number of Key=Value pairs in a text message */
633632
#define MAX_KEY_VALUE_PAIRS 8192

0 commit comments

Comments
 (0)