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/[email protected]

Signed-off-by: Dmitry Bogdanov <[email protected]>
Signed-off-by: Mike Christie <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Co-authored-by: Dmitry Bogdanov <[email protected]>
  • Loading branch information
2 people authored and prakashsurya committed Sep 23, 2024
1 parent 1d23b4e commit 5c74cf8
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 5c74cf8

Please sign in to comment.