Skip to content

Commit 2db811c

Browse files
Nicholas Bellingergregkh
authored andcommitted
target: Fix delayed Task Aborted Status (TAS) handling bug
commit 29f4c09 upstream. This patch fixes a bug in delayed Task Aborted Status (TAS) handling, where transport_send_task_abort() was not returning for the case when the se_tfo->write_pending() callback indicated that last fabric specific WRITE PDU had not yet been received. It also adds an explicit cmd->scsi_status = SAM_STAT_TASK_ABORTED assignment within transport_check_aborted_status() to avoid the case where se_tfo->queue_status() is called when the SAM_STAT_TASK_ABORTED assignment + ->queue_status() in transport_send_task_abort() does not occur once SCF_SENT_DELAYED_TAS has been set. Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ba10405 commit 2db811c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/target/target_core_transport.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2910,6 +2910,7 @@ int transport_check_aborted_status(struct se_cmd *cmd, int send_status)
29102910
cmd->t_task_cdb[0], cmd->se_tfo->get_task_tag(cmd));
29112911

29122912
cmd->se_cmd_flags |= SCF_SENT_DELAYED_TAS;
2913+
cmd->scsi_status = SAM_STAT_TASK_ABORTED;
29132914
trace_target_cmd_complete(cmd);
29142915
cmd->se_tfo->queue_status(cmd);
29152916

@@ -2938,6 +2939,7 @@ void transport_send_task_abort(struct se_cmd *cmd)
29382939
if (cmd->se_tfo->write_pending_status(cmd) != 0) {
29392940
cmd->transport_state |= CMD_T_ABORTED;
29402941
smp_mb__after_atomic_inc();
2942+
return;
29412943
}
29422944
}
29432945
cmd->scsi_status = SAM_STAT_TASK_ABORTED;

0 commit comments

Comments
 (0)