Skip to content

Commit a64f1f4

Browse files
pzakhaDelphix Engineering
authored andcommitted
DLPX-72065 Aborted iSCSI command never completes after LUN reset (#4)
1 parent 252cc72 commit a64f1f4

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

drivers/target/iscsi/iscsi_target_erl1.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,18 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)
11011101

11021102
iscsit_inc_conn_usage_count(conn);
11031103

1104+
/*
1105+
* If the command was aborted, for instance following a LUN RESET,
1106+
* a dataout timeout might be normal.
1107+
*/
1108+
if (target_cmd_interrupted(&cmd->se_cmd)) {
1109+
pr_debug("DataOut timeout on interrupted cmd with"
1110+
" ITT[0x%08llx]\n", cmd->se_cmd.tag);
1111+
cmd->dataout_timer_flags &= ~ISCSI_TF_RUNNING;
1112+
iscsit_dec_conn_usage_count(conn);
1113+
return;
1114+
}
1115+
11041116
spin_lock_bh(&cmd->dataout_timeout_lock);
11051117
if (cmd->dataout_timer_flags & ISCSI_TF_STOP) {
11061118
spin_unlock_bh(&cmd->dataout_timeout_lock);
@@ -1114,19 +1126,22 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)
11141126
if (!sess->sess_ops->ErrorRecoveryLevel) {
11151127
pr_err("Unable to recover from DataOut timeout while"
11161128
" in ERL=0, closing iSCSI connection for I_T Nexus"
1117-
" %s,i,0x%6phN,%s,t,0x%02x\n",
1129+
" %s,i,0x%6phN,%s,t,0x%02x, cmd ITT[0x%08llx]\n",
11181130
sess->sess_ops->InitiatorName, sess->isid,
1119-
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt);
1131+
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt,
1132+
cmd->se_cmd.tag);
11201133
goto failure;
11211134
}
11221135

11231136
if (++cmd->dataout_timeout_retries == na->dataout_timeout_retries) {
11241137
pr_err("Command ITT: 0x%08x exceeded max retries"
11251138
" for DataOUT timeout %u, closing iSCSI connection for"
1126-
" I_T Nexus %s,i,0x%6phN,%s,t,0x%02x\n",
1139+
" I_T Nexus %s,i,0x%6phN,%s,t,0x%02x,"
1140+
" cmd ITT[0x%08llx]\n",
11271141
cmd->init_task_tag, na->dataout_timeout_retries,
11281142
sess->sess_ops->InitiatorName, sess->isid,
1129-
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt);
1143+
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt,
1144+
cmd->se_cmd.tag);
11301145
goto failure;
11311146
}
11321147

drivers/target/target_core_transport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ static void target_abort_work(struct work_struct *work)
882882
target_handle_abort(cmd);
883883
}
884884

885-
static bool target_cmd_interrupted(struct se_cmd *cmd)
885+
bool target_cmd_interrupted(struct se_cmd *cmd)
886886
{
887887
int post_ret;
888888

@@ -901,6 +901,7 @@ static bool target_cmd_interrupted(struct se_cmd *cmd)
901901

902902
return false;
903903
}
904+
EXPORT_SYMBOL(target_cmd_interrupted);
904905

905906
/* May be called from interrupt context so must not sleep. */
906907
void target_complete_cmd_with_sense(struct se_cmd *cmd, u8 scsi_status,

include/target/target_core_fabric.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ sense_reason_t transport_generic_new_cmd(struct se_cmd *);
191191

192192
void target_put_cmd_and_wait(struct se_cmd *cmd);
193193
void target_execute_cmd(struct se_cmd *cmd);
194+
bool target_cmd_interrupted(struct se_cmd *cmd);
194195

195196
int transport_generic_free_cmd(struct se_cmd *, int);
196197

0 commit comments

Comments
 (0)