mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-02 01:06:46 +09:00
target: Prevent transport_send_task_abort when CHECK_CONDITION status
commit c252f00347 upstream.
This patch fixes a bug where transport_send_task_abort() could be called
during LUN_RESET to return SAM_STAT_TASK_ABORTED + tfo->queue_status(), when
SCF_SENT_CHECK_CONDITION -> tfo->queue_status() has already been sent from
within another context via transport_send_check_condition_and_sense().
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
15e2ab5ff4
commit
6f47552250
@@ -4920,6 +4920,15 @@ EXPORT_SYMBOL(transport_check_aborted_status);
|
||||
|
||||
void transport_send_task_abort(struct se_cmd *cmd)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&cmd->t_state_lock, flags);
|
||||
if (cmd->se_cmd_flags & SCF_SENT_CHECK_CONDITION) {
|
||||
spin_unlock_irqrestore(&cmd->t_state_lock, flags);
|
||||
return;
|
||||
}
|
||||
spin_unlock_irqrestore(&cmd->t_state_lock, flags);
|
||||
|
||||
/*
|
||||
* If there are still expected incoming fabric WRITEs, we wait
|
||||
* until until they have completed before sending a TASK_ABORTED
|
||||
|
||||
Reference in New Issue
Block a user