Skip to content

Commit

Permalink
DLPX-91889 scsi: target: iscsi: Handle abort for WRITE_PENDING cmds (#53
Browse files Browse the repository at this point in the history
)

Link: https://lore.kernel.org/r/20230319015620.96006-10-michael.christie@oracle.com

Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Co-authored-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
  • Loading branch information
2 people authored and Delphix Engineering committed Nov 10, 2024
1 parent 27e4f0b commit c48e503
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <target/target_core_base.h>
#include <target/target_core_fabric.h>

#include <target/target_core_backend.h>
#include <target/iscsi/iscsi_target_core.h>
#include "iscsi_target_parameters.h"
#include "iscsi_target_seq_pdu_list.h"
Expand Down Expand Up @@ -4104,6 +4105,16 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
} else {
se_cmd->transport_state |= CMD_T_FABRIC_STOP;
}

if (cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING) {
/*
* We never submitted the cmd to LIO core, so we have
* to tell LIO to perform the completion process.
*/
spin_unlock_irq(&se_cmd->t_state_lock);
target_complete_cmd(&cmd->se_cmd, SAM_STAT_TASK_ABORTED);
continue;
}
spin_unlock_irq(&se_cmd->t_state_lock);
}
spin_unlock_bh(&conn->cmd_lock);
Expand Down

0 comments on commit c48e503

Please sign in to comment.