Skip to content

Commit 265e018

Browse files
pcd1193182logost
authored and
Delphix Engineering
committed
DLPX-91889 scsi: target: iscsi: Handle abort for WRITE_PENDING cmds (#53)
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]>
1 parent ed9dc3d commit 265e018

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/target/iscsi/iscsi_target.c

+11
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <target/target_core_base.h>
2727
#include <target/target_core_fabric.h>
2828

29+
#include <target/target_core_backend.h>
2930
#include <target/iscsi/iscsi_target_core.h>
3031
#include "iscsi_target_parameters.h"
3132
#include "iscsi_target_seq_pdu_list.h"
@@ -4104,6 +4105,16 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
41044105
} else {
41054106
se_cmd->transport_state |= CMD_T_FABRIC_STOP;
41064107
}
4108+
4109+
if (cmd->se_cmd.t_state == TRANSPORT_WRITE_PENDING) {
4110+
/*
4111+
* We never submitted the cmd to LIO core, so we have
4112+
* to tell LIO to perform the completion process.
4113+
*/
4114+
spin_unlock_irq(&se_cmd->t_state_lock);
4115+
target_complete_cmd(&cmd->se_cmd, SAM_STAT_TASK_ABORTED);
4116+
continue;
4117+
}
41074118
spin_unlock_irq(&se_cmd->t_state_lock);
41084119
}
41094120
spin_unlock_bh(&conn->cmd_lock);

0 commit comments

Comments
 (0)