linux/drivers/target
Roland Dreier bcac364a24 target: Fix race between multiple invocations of target_qf_do_work()
When work is scheduled with schedule_work(), the work can end up
running on multiple CPUs at the same time -- this happens if
the work is already running on one CPU and schedule_work() is called
on another CPU.  This leads to list corruption with target_qf_do_work(),
which is roughly doing:

	spin_lock(...);
	list_for_each_entry_safe(...) {
		list_del(...);
		spin_unlock(...);

		// do stuff

		spin_lock(...);
	}

With multiple CPUs running this code, one CPU can end up deleting the
list entry that the other CPU is about to work on.

Fix this by splicing the list entries onto a local list and then
operating on that in the work function.  This way, each invocation of
target_qf_do_work() operates on its own local list and so multiple
invocations don't corrupt each other's list.  This also avoids dropping
and reacquiring the lock for each list entry.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2011-09-16 09:29:20 +00:00
..
iscsi iscsi-target: Fix iscsit_allocate_se_cmd_for_tmr failure path bugs 2011-08-22 19:26:30 +00:00
loopback target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
tcm_fc target: Convert acl_node_lock to be IRQ-disabling 2011-08-22 19:28:36 +00:00
Kconfig iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
Makefile iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
target_core_alua.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_alua.h [SCSI] target: Add LIO target core v4.0.0-rc6 2011-01-14 10:12:29 -06:00
target_core_cdb.c target: Print subpage too for unhandled MODE SENSE pages 2011-08-22 19:26:31 +00:00
target_core_configfs.c target: fix typo Assoication -> Association 2011-07-22 09:37:49 +00:00
target_core_device.c target: Convert acl_node_lock to be IRQ-disabling 2011-08-22 19:28:36 +00:00
target_core_fabric_configfs.c target: Use ERR_CAST inlined function 2011-08-22 19:26:15 +00:00
target_core_fabric_lib.c target: remove custom hex2bin() implementation 2011-07-22 09:37:49 +00:00
target_core_file.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_file.h target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_hba.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_hba.h [SCSI] target: Add LIO target core v4.0.0-rc6 2011-01-14 10:12:29 -06:00
target_core_iblock.c target: ->map_task_SG conversion to ->map_control_SG and ->map_data_SG 2011-07-22 09:37:48 +00:00
target_core_iblock.h target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_pr.c target: Convert acl_node_lock to be IRQ-disabling 2011-08-22 19:28:36 +00:00
target_core_pr.h target: Core cleanups from AGrover (round 1) 2011-07-22 09:37:43 +00:00
target_core_pscsi.c target: ->map_task_SG conversion to ->map_control_SG and ->map_data_SG 2011-07-22 09:37:48 +00:00
target_core_pscsi.h target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_rd.c target: Convert target_core_rd.c to use use BUG_ON 2011-08-22 19:26:17 +00:00
target_core_rd.h target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_scdb.c target: Pass 2nd param of transport_split_cdb by value 2011-07-22 09:37:48 +00:00
target_core_scdb.h target: Pass 2nd param of transport_split_cdb by value 2011-07-22 09:37:48 +00:00
target_core_stat.c target: Core cleanups from AGrover (round 1) 2011-07-22 09:37:43 +00:00
target_core_stat.h [SCSI] target: add initial statistics 2011-03-23 11:36:50 -05:00
target_core_tmr.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_tpg.c target: Convert acl_node_lock to be IRQ-disabling 2011-08-22 19:28:36 +00:00
target_core_transport.c target: Fix race between multiple invocations of target_qf_do_work() 2011-09-16 09:29:20 +00:00
target_core_ua.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_ua.h [SCSI] target: Add LIO target core v4.0.0-rc6 2011-01-14 10:12:29 -06:00