On Wed, 2017-02-08 at 14:24 -0800, Bart Van Assche wrote: > Target drivers must call target_sess_cmd_list_set_waiting() and > target_wait_for_sess_cmds() before freeing a session. Instead of > setting a flag in each pending command from the former function > and waiting in the latter function on a per-command completion, > only set a per-session flag in the former function and wait on > a per-session completion in the latter function. Note: this patch > changes the behavior from aborting outstanding commands back to > waiting for command completion. This makes the session shutdown > code simpler. This change is safe because once a SCSI initiator > system has submitted a command a target system is always allowed > to execute it to completion. See also commit 0f4a943168f3 > ("target: Fix remote-port TMR ABORT + se_cmd fabric stop"). > > This patch is based on the following two patches: > * Bart Van Assche, target: Simplify session shutdown code, February 19, 2015 > (https://github.com/bvanassche/linux/commit/8df5463d7d7619f2f1b70cfe5172eaef0aa52815). > * Christoph Hellwig, target: Rework session shutdown code, December 7, 2015 > (http://thread.gmane.org/gmane.linux.scsi.target.devel/10695). > > Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx> > Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> > Cc: Christoph Hellwig <hch@xxxxxx> > Cc: Sagi Grimberg <sagig@xxxxxxxxxxxx> > Cc: Andy Grover <agrover@xxxxxxxxxx> > --- Because this patch depends upon TMR logic in patch #17 that broken from multiple perspectives, dropping this patch for now. -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html