linux/drivers/target
Nicholas Bellinger 9afdedacc7 target: Fix race with SCF_SEND_DELAYED_TAS handling
commit 310d3d314b upstream.

This patch fixes a race between setting of SCF_SEND_DELAYED_TAS
in transport_send_task_abort(), and check of the same bit in
transport_check_aborted_status().

It adds a __transport_check_aborted_status() version that is
used by target_execute_cmd() when se_cmd->t_state_lock is
held, and a transport_check_aborted_status() wrapper for
all other existing callers.

Also, it handles the case where the check happens before
transport_send_task_abort() gets called.  For this, go
ahead and set SCF_SEND_DELAYED_TAS early when necessary,
and have transport_send_task_abort() send the abort.

Cc: Quinn Tran <quinn.tran@qlogic.com>
Cc: Himanshu Madhani <himanshu.madhani@qlogic.com>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[ luis: backported to 3.16: based on Nicholas' backport to 3.14 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2016-03-24 10:00:49 +00:00
..
iscsi iscsi-target: Fix potential dead-lock during node acl delete 2016-02-02 19:10:05 +00:00
loopback tcm_loop: Fixup tag handling 2015-01-22 16:33:35 +00:00
sbp target: Pass in transport supported PI at session initialization 2014-04-07 01:48:54 -07:00
tcm_fc tcm_fc: missing curly braces in ft_invl_hw_context() 2015-03-30 11:11:42 +01:00
Kconfig target/iblock: Add blk_integrity + BIP passthrough support 2014-01-18 10:14:22 +00:00
Makefile target: Add support for EXTENDED_COPY copy offload emulation 2013-09-10 16:48:43 -07:00
target_core_alua.c Merge branch 'next' (accumulated 3.16 merge window patches) into master 2014-06-08 11:31:16 -07:00
target_core_alua.h target_core_alua: Referrals configfs integration 2014-01-09 21:48:35 -08:00
target_core_configfs.c target: Fix a memory leak in target_dev_lba_map_store() 2016-02-02 19:48:58 +00:00
target_core_device.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-02-25 00:18:38 +00:00
target_core_fabric_configfs.c target: Fix sizeof in kmalloc for some default_groups arrays 2013-12-16 12:42:20 -08:00
target_core_fabric_lib.c target: Update copyright ownership/year information to 2013 2013-09-10 20:23:36 -07:00
target_core_file.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-02-25 00:18:38 +00:00
target_core_file.h Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2014-01-31 15:31:23 -08:00
target_core_hba.c target: Update copyright ownership/year information to 2013 2013-09-10 20:23:36 -07:00
target_core_iblock.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-02-25 00:18:38 +00:00
target_core_iblock.h target: kill struct se_subsystem_dev 2012-11-06 20:55:43 -08:00
target_core_internal.h target/configfs: Expose protection device attributes 2014-01-18 09:57:47 +00:00
target_core_pr.c target: Allow Write Exclusive non-reservation holders to READ 2015-03-03 14:24:08 +00:00
target_core_pr.h target: Fix APTPL metadata handling for dynamic MappedLUNs 2014-11-05 11:43:05 +00:00
target_core_pscsi.c target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST 2015-06-03 14:30:06 +01:00
target_core_pscsi.h target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST 2015-06-03 14:30:06 +01:00
target_core_rd.c target/rd: T10-Dif: RAM disk is allocating more space than required. 2014-04-07 01:48:53 -07:00
target_core_rd.h target/rd: Add support for protection SGL setup + release 2014-01-19 02:22:05 +00:00
target_core_sbc.c target: fix COMPARE_AND_WRITE non zero SGL offset data corruption 2015-12-18 16:06:39 +00:00
target_core_spc.c target: REPORT LUNS should return LUN 0 even for dynamic ACLs 2015-08-31 14:14:07 +01:00
target_core_stat.c target: Convert se_device statistics to atomic_long_t 2013-11-13 18:34:55 -08:00
target_core_tmr.c target: Fix remote-port TMR ABORT + se_cmd fabric stop 2016-03-24 10:00:49 +00:00
target_core_tpg.c target: Fix APTPL metadata handling for dynamic MappedLUNs 2014-11-05 11:43:05 +00:00
target_core_transport.c target: Fix race with SCF_SEND_DELAYED_TAS handling 2016-03-24 10:00:49 +00:00
target_core_ua.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
target_core_ua.h target core: rename (ex,im)plict -> (ex,im)plicit 2013-11-20 11:24:40 -08:00
target_core_xcopy.c target: cleanup some boolean tests 2014-06-06 14:21:01 -07:00
target_core_xcopy.h target: Add support for EXTENDED_COPY copy offload emulation 2013-09-10 16:48:43 -07:00