Skip to content

Commit 8ac72ea

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

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

drivers/target/iscsi/iscsi_target_erl1.c

+19-4
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,18 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)
11021102

11031103
iscsit_inc_conn_usage_count(conn);
11041104

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

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

drivers/target/target_core_transport.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ static void target_abort_work(struct work_struct *work)
849849
target_handle_abort(cmd);
850850
}
851851

852-
static bool target_cmd_interrupted(struct se_cmd *cmd)
852+
bool target_cmd_interrupted(struct se_cmd *cmd)
853853
{
854854
int post_ret;
855855

@@ -868,6 +868,7 @@ static bool target_cmd_interrupted(struct se_cmd *cmd)
868868

869869
return false;
870870
}
871+
EXPORT_SYMBOL(target_cmd_interrupted);
871872

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

include/target/target_core_fabric.h

+1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ sense_reason_t transport_generic_new_cmd(struct se_cmd *);
176176

177177
void target_put_cmd_and_wait(struct se_cmd *cmd);
178178
void target_execute_cmd(struct se_cmd *cmd);
179+
bool target_cmd_interrupted(struct se_cmd *cmd);
179180

180181
int transport_generic_free_cmd(struct se_cmd *, int);
181182

0 commit comments

Comments
 (0)