diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2016-01-07 13:36:46 +0100 |
---|---|---|
committer | Bart Van Assche <bart.vanassche@sandisk.com> | 2017-02-08 16:41:08 -0800 |
commit | 1e974edd2990e4e9de7062e784003ccdca467790 (patch) | |
tree | f86a0b19608f86820a40c7789e41e5680fd7ae76 /include/target | |
parent | 24b6ebcf2abdade33ed3b648fa8d204b1bd1b13a (diff) |
target: Make ABORT and LUN RESET handling synchronous
Instead of invoking target driver callback functions from the
context that handles an abort or LUN RESET task management function,
only set the abort flag from that context and perform the actual
abort handling from the context of the regular command processing
flow. This approach has the following advantages:
- The task management function code becomes much easier to read and
to verify since the number of potential race conditions against
the command processing flow is strongly reduced.
- It is no longer needed to store the command state into the command
itself since that information is no longer needed from the context
where a task management function is processed.
Notes:
- With this patch applied the CMD_T_ABORTED flag is checked at two points
by the target core: just before local execution of a command starts
(see also target_execute_cmd()) and also just before the response is
sent (see also target_complete_cmd()).
- A new reference count is introduced that tracks the number of
references held by the target driver, namely se_cmd.tgt_ref.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: David Disseldorp <ddiss@suse.de>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index c84e5eecb94d..e5e0fd852ff5 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -444,6 +444,7 @@ struct se_cmd { unsigned cmd_wait_set:1; unsigned unknown_data_length:1; bool state_active:1; + bool send_abort_response:1; u64 tag; /* SAM command identifier aka task tag */ /* Delay for ALUA Active/NonOptimized state access in milliseconds */ int alua_nonop_delay; |