From fbbd49235590ca759aada500b5a935e06b7f6708 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 27 Nov 2018 15:52:01 -0800 Subject: scsi: target/core: Simplify the code for aborting SCSI commands Instead of allowing the code that aborts a SCSI command to finish before all iSCSI data frames have been received, make that code wait until all iSCSI data frames have been received. Introduce a new member variable in the target driver template to communicate that information from the iSCSI target driver to the target core. This change allows to leave out the check whether or not it is already safe to send the TASK_ABORTED reply from transport_send_task_abort(). Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- include/target/target_core_fabric.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/target') diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 3b81a5b01497..7c62923b16b6 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -111,6 +111,13 @@ struct target_core_fabric_ops { struct configfs_attribute **tfc_tpg_nacl_attrib_attrs; struct configfs_attribute **tfc_tpg_nacl_auth_attrs; struct configfs_attribute **tfc_tpg_nacl_param_attrs; + + /* + * Set this member variable to true if the SCSI transport protocol + * (e.g. iSCSI) requires that the Data-Out buffer is transferred in + * its entirety before a command is aborted. + */ + bool write_pending_must_be_called; }; int target_register_template(const struct target_core_fabric_ops *fo); -- cgit v1.2.3-59-g8ed1b