On 01/26/2017 12:36 AM, 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. 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> > Cc: Christoph Hellwig <hch@xxxxxx> > Cc: Sagi Grimberg <sagig@xxxxxxxxxxxx> > Cc: Andy Grover <agrover@xxxxxxxxxx> > --- > drivers/target/target_core_tmr.c | 4 +- > drivers/target/target_core_transport.c | 106 ++++++++------------------------- > include/target/target_core_base.h | 4 +- > 3 files changed, 29 insertions(+), 85 deletions(-) > Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> Cheers, Hannes -- Dr. Hannes Reinecke zSeries & Storage hare@xxxxxxxx +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg) -- 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