Skip to content

Commit f2859ea

Browse files
pzakhaDelphix Engineering
authored and
Delphix Engineering
committed
DLPX-72065 Aborted iSCSI command never completes after LUN reset (#4)
1 parent 6d298fc commit f2859ea

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
@@ -1104,6 +1104,18 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)
11041104

11051105
iscsit_inc_conn_usage_count(conn);
11061106

1107+
/*
1108+
* If the command was aborted, for instance following a LUN RESET,
1109+
* a dataout timeout might be normal.
1110+
*/
1111+
if (target_cmd_interrupted(&cmd->se_cmd)) {
1112+
pr_debug("DataOut timeout on interrupted cmd with"
1113+
" ITT[0x%08llx]\n", cmd->se_cmd.tag);
1114+
cmd->dataout_timer_flags &= ~ISCSI_TF_RUNNING;
1115+
iscsit_dec_conn_usage_count(conn);
1116+
return;
1117+
}
1118+
11071119
spin_lock_bh(&cmd->dataout_timeout_lock);
11081120
if (cmd->dataout_timer_flags & ISCSI_TF_STOP) {
11091121
spin_unlock_bh(&cmd->dataout_timeout_lock);
@@ -1117,19 +1129,22 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)
11171129
if (!sess->sess_ops->ErrorRecoveryLevel) {
11181130
pr_err("Unable to recover from DataOut timeout while"
11191131
" in ERL=0, closing iSCSI connection for I_T Nexus"
1120-
" %s,i,0x%6phN,%s,t,0x%02x\n",
1132+
" %s,i,0x%6phN,%s,t,0x%02x, cmd ITT[0x%08llx]\n",
11211133
sess->sess_ops->InitiatorName, sess->isid,
1122-
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt);
1134+
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt,
1135+
cmd->se_cmd.tag);
11231136
goto failure;
11241137
}
11251138

11261139
if (++cmd->dataout_timeout_retries == na->dataout_timeout_retries) {
11271140
pr_err("Command ITT: 0x%08x exceeded max retries"
11281141
" for DataOUT timeout %u, closing iSCSI connection for"
1129-
" I_T Nexus %s,i,0x%6phN,%s,t,0x%02x\n",
1142+
" I_T Nexus %s,i,0x%6phN,%s,t,0x%02x,"
1143+
" cmd ITT[0x%08llx]\n",
11301144
cmd->init_task_tag, na->dataout_timeout_retries,
11311145
sess->sess_ops->InitiatorName, sess->isid,
1132-
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt);
1146+
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt,
1147+
cmd->se_cmd.tag);
11331148
goto failure;
11341149
}
11351150

drivers/target/target_core_transport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ static void target_abort_work(struct work_struct *work)
816816
target_handle_abort(cmd);
817817
}
818818

819-
static bool target_cmd_interrupted(struct se_cmd *cmd)
819+
bool target_cmd_interrupted(struct se_cmd *cmd)
820820
{
821821
int post_ret;
822822

@@ -835,6 +835,7 @@ static bool target_cmd_interrupted(struct se_cmd *cmd)
835835

836836
return false;
837837
}
838+
EXPORT_SYMBOL(target_cmd_interrupted);
838839

839840
/* May be called from interrupt context so must not sleep. */
840841
void target_complete_cmd(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
@@ -168,6 +168,7 @@ sense_reason_t transport_generic_new_cmd(struct se_cmd *);
168168

169169
void target_put_cmd_and_wait(struct se_cmd *cmd);
170170
void target_execute_cmd(struct se_cmd *cmd);
171+
bool target_cmd_interrupted(struct se_cmd *cmd);
171172

172173
int transport_generic_free_cmd(struct se_cmd *, int);
173174

0 commit comments

Comments
 (0)