Skip to content

DLPX-72065 Aborted iSCSI command never completes after LUN reset #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions drivers/target/iscsi/iscsi_target_erl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,18 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)

iscsit_inc_conn_usage_count(conn);

/*
* If the command was aborted, for instance following a LUN RESET,
* a dataout timeout might be normal.
*/
if (target_cmd_interrupted(&cmd->se_cmd)) {
pr_debug("DataOut timeout on interrupted cmd with"
" ITT[0x%08llx]\n", cmd->se_cmd.tag);
cmd->dataout_timer_flags &= ~ISCSI_TF_RUNNING;
iscsit_dec_conn_usage_count(conn);
return;
}

spin_lock_bh(&cmd->dataout_timeout_lock);
if (cmd->dataout_timer_flags & ISCSI_TF_STOP) {
spin_unlock_bh(&cmd->dataout_timeout_lock);
Expand All @@ -1117,19 +1129,22 @@ void iscsit_handle_dataout_timeout(struct timer_list *t)
if (!sess->sess_ops->ErrorRecoveryLevel) {
pr_err("Unable to recover from DataOut timeout while"
" in ERL=0, closing iSCSI connection for I_T Nexus"
" %s,i,0x%6phN,%s,t,0x%02x\n",
" %s,i,0x%6phN,%s,t,0x%02x, cmd ITT[0x%08llx]\n",
sess->sess_ops->InitiatorName, sess->isid,
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt);
sess->tpg->tpg_tiqn->tiqn, (u32)sess->tpg->tpgt,
cmd->se_cmd.tag);
goto failure;
}

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

Expand Down
3 changes: 2 additions & 1 deletion drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ static void target_abort_work(struct work_struct *work)
target_handle_abort(cmd);
}

static bool target_cmd_interrupted(struct se_cmd *cmd)
bool target_cmd_interrupted(struct se_cmd *cmd)
{
int post_ret;

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

return false;
}
EXPORT_SYMBOL(target_cmd_interrupted);

/* May be called from interrupt context so must not sleep. */
void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status)
Expand Down
1 change: 1 addition & 0 deletions include/target/target_core_fabric.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ sense_reason_t transport_generic_new_cmd(struct se_cmd *);

void target_put_cmd_and_wait(struct se_cmd *cmd);
void target_execute_cmd(struct se_cmd *cmd);
bool target_cmd_interrupted(struct se_cmd *cmd);

int transport_generic_free_cmd(struct se_cmd *, int);

Expand Down