target: Use CMD_T_PRE_EXECUTE for pre-backend execution quiese
With CMD_T_PRE_EXECUTE in place within target_get_sess_cmd(),
it's now possible differentiate when to quiese a se_cmd within
__transport_wait_for_tasks(), beyond the existing CMD_T_ACTIVE
bit set before backend driver dispatch in target_execute_cmd().
This is useful when a command is explicitly CMD_T_ABORTED but
not yet reached backend driver code, namely when a solicited
data-out transfer is occuring and we must wait until the
transfer has completed before completing the abort.
Historically CMD_T_ABORTED quiese would not block on anything
other than CMD_T_ACTIVE, causing se_cmd WRITEs with soliciated
data-out to require a seperate mechanism (SCF_SEND_DELAYED_TAS)
to handle SAM_STAT_ABORTED response callbacks after quiese.
This patch allows __transport_wait_for_tasks() to block on
se_cmd descriptors with CMD_T_PRE_EXECUTE + aborted set,
allowing data-out transfers to occur before completing
quiese and proceeding with abort.
It includes updating __transport_wait_for_tasks() to check
for CMD_T_PRE_EXECUTE during fabric_stop + aborted case, in
order to wakeup the se_device->tmr_wq blocked during se_cmd
descriptor quiese when session recovery occurs concurrently
during an active abort operation.
On the existing __transport_check_aborted_status() side,
convert existing code to check for CMD_T_STOP|CMD_T_ABORTED
and complete the quiese when necessary.
Finally, kill the TFO->write_pending_status() callback
in transport_send_task_abort() since all pending writes
are quiesed directly by __transport_wait_for_tasks().
Reported-by: Donald White <dew@datera.io>
Cc: Donald White <dew@datera.io>
Cc: Mike Christie <mchristi@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Cc: Quinn Tran <quinn.tran@cavium.com>
Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
1 file changed