From c38a8c1d9a6f71e13f9933956f7c0d4db6792360 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Tue, 22 Mar 2016 17:10:43 +0100 Subject: [PATCH] task_mgmt: don't cancel local PDUs on ABORT TASK Currently the iscsi_task_mgmt_abort_task_[a]sync() functions cancel any queued or dispatched (awaiting response) PDUs prior to transmitting the ABORT TASK TMF request, which means that a TMF request may be sent which references a PDU that the target never received. Bug: https://github.com/sahlberg/libiscsi/issues/192 Signed-off-by: David Disseldorp --- lib/sync.c | 2 -- lib/task_mgmt.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/lib/sync.c b/lib/sync.c index 6f18a42..93f52ca 100644 --- a/lib/sync.c +++ b/lib/sync.c @@ -276,8 +276,6 @@ int iscsi_task_mgmt_abort_task_sync(struct iscsi_context *iscsi, struct scsi_task *task) { - iscsi_scsi_cancel_task(iscsi, task); - return iscsi_task_mgmt_sync(iscsi, task->lun, ISCSI_TM_ABORT_TASK, task->itt, task->cmdsn); diff --git a/lib/task_mgmt.c b/lib/task_mgmt.c index dd1e760..b00b6fa 100644 --- a/lib/task_mgmt.c +++ b/lib/task_mgmt.c @@ -101,14 +101,11 @@ iscsi_process_task_mgmt_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu return 0; } - int iscsi_task_mgmt_abort_task_async(struct iscsi_context *iscsi, struct scsi_task *task, iscsi_command_cb cb, void *private_data) { - iscsi_scsi_cancel_task(iscsi, task); - return iscsi_task_mgmt_async(iscsi, task->lun, ISCSI_TM_ABORT_TASK, task->itt, task->cmdsn,