hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/target/iscsi/iscsi_target.c
....@@ -4084,9 +4084,12 @@
40844084 list_for_each_entry_safe(cmd, cmd_tmp, &tmp_list, i_conn_node) {
40854085 struct se_cmd *se_cmd = &cmd->se_cmd;
40864086
4087
- if (se_cmd->se_tfo != NULL) {
4088
- spin_lock_irq(&se_cmd->t_state_lock);
4089
- if (se_cmd->transport_state & CMD_T_ABORTED) {
4087
+ if (!se_cmd->se_tfo)
4088
+ continue;
4089
+
4090
+ spin_lock_irq(&se_cmd->t_state_lock);
4091
+ if (se_cmd->transport_state & CMD_T_ABORTED) {
4092
+ if (!(se_cmd->transport_state & CMD_T_TAS))
40904093 /*
40914094 * LIO's abort path owns the cleanup for this,
40924095 * so put it back on the list and let
....@@ -4094,11 +4097,10 @@
40944097 */
40954098 list_move_tail(&cmd->i_conn_node,
40964099 &conn->conn_cmd_list);
4097
- } else {
4098
- se_cmd->transport_state |= CMD_T_FABRIC_STOP;
4099
- }
4100
- spin_unlock_irq(&se_cmd->t_state_lock);
4100
+ } else {
4101
+ se_cmd->transport_state |= CMD_T_FABRIC_STOP;
41014102 }
4103
+ spin_unlock_irq(&se_cmd->t_state_lock);
41024104 }
41034105 spin_unlock_bh(&conn->cmd_lock);
41044106
....@@ -4383,6 +4385,9 @@
43834385 iscsit_stop_time2retain_timer(sess);
43844386 spin_unlock_bh(&se_tpg->session_lock);
43854387
4388
+ if (sess->sess_ops->ErrorRecoveryLevel == 2)
4389
+ iscsit_free_connection_recovery_entries(sess);
4390
+
43864391 /*
43874392 * transport_deregister_session_configfs() will clear the
43884393 * struct se_node_acl->nacl_sess pointer now as a iscsi_np process context
....@@ -4409,9 +4414,6 @@
44094414 }
44104415
44114416 transport_deregister_session(sess->se_sess);
4412
-
4413
- if (sess->sess_ops->ErrorRecoveryLevel == 2)
4414
- iscsit_free_connection_recovery_entries(sess);
44154417
44164418 iscsit_free_all_ooo_cmdsns(sess);
44174419