alistair23-linux/drivers/target
Nicholas Bellinger a6d9bb1c96 target: Fix LUN_RESET active TMR descriptor handling
This patch fixes a NULL pointer se_cmd->cmd_kref < 0
refcount bug during TMR LUN_RESET with active TMRs,
triggered during se_cmd + se_tmr_req descriptor
shutdown + release via core_tmr_drain_tmr_list().

To address this bug, go ahead and obtain a local
kref_get_unless_zero(&se_cmd->cmd_kref) for active I/O
to set CMD_T_ABORTED, and transport_wait_for_tasks()
followed by the final target_put_sess_cmd() to drop
the local ->cmd_kref.

Also add two new checks within target_tmr_work() to
avoid CMD_T_ABORTED -> TFO->queue_tm_rsp() callbacks
ahead of invoking the backend -> fabric put in
transport_cmd_check_stop_to_fabric().

For good measure, also change core_tmr_release_req()
to use list_del_init() ahead of se_tmr_req memory
free.

Reviewed-by: 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>
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2016-02-03 14:09:47 -08:00
..
iscsi Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
loopback tcm_loop: Show address of tpg in configfs 2015-11-29 03:01:45 -08:00
sbp sbp-target: Remove a superfluous forward declaration 2016-01-06 13:39:53 -08:00
tcm_fc tcm_fc: Convert acl lookup to modern get_initiator_node_acl usage 2016-01-12 23:17:51 -08:00
Kconfig
Makefile
target_core_alua.c
target_core_alua.h
target_core_configfs.c target: Fix a memory leak in target_dev_lba_map_store() 2016-01-07 13:57:55 -08:00
target_core_device.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-01-29 19:29:34 -08:00
target_core_fabric_configfs.c target: use per-attribute show and store methods 2015-10-13 22:17:49 -07:00
target_core_fabric_lib.c
target_core_file.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-01-29 19:29:34 -08:00
target_core_file.h
target_core_hba.c target: Fix target_sense_desc_format NULL pointer dereference 2015-09-24 23:17:23 -07:00
target_core_iblock.c target: Fix WRITE_SAME/DISCARD conversion to linux 512b sectors 2016-01-29 19:29:34 -08:00
target_core_iblock.h
target_core_internal.h target: use per-attribute show and store methods 2015-10-13 22:17:49 -07:00
target_core_pr.c target: Fix spelling + remove set-but-not-used variables 2016-01-06 13:38:37 -08:00
target_core_pr.h
target_core_pscsi.c
target_core_pscsi.h
target_core_rd.c
target_core_rd.h
target_core_sbc.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
target_core_spc.c target/sbc: Add LBPRZ attribute + control CDB emulation 2016-01-06 13:39:55 -08:00
target_core_stat.c target/stat: print full t10_wwn.model buffer 2015-11-28 21:23:13 -08:00
target_core_tmr.c target: Fix LUN_RESET active TMR descriptor handling 2016-02-03 14:09:47 -08:00
target_core_tpg.c target: Obtain se_node_acl->acl_kref during get_initiator_node_acl 2016-01-20 01:34:15 -08:00
target_core_transport.c target: Fix LUN_RESET active TMR descriptor handling 2016-02-03 14:09:47 -08:00
target_core_ua.c
target_core_ua.h
target_core_user.c Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2016-01-20 17:20:53 -08:00
target_core_xcopy.c
target_core_xcopy.h