]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
target: Fix interrupt context bug with stats_lock and core_tmr_alloc_req
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 20 May 2011 03:19:10 +0000 (20:19 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Jun 2011 01:34:04 +0000 (10:34 +0900)
commitc690d5d2e4f68f2203071118a423357ed108f2ea
tree6d4ccaa6fdf67cd075588b09bad0c186841d08b4
parentbaee56a2ef25317d47dbbb65eddaea25a1c46b99
target: Fix interrupt context bug with stats_lock and core_tmr_alloc_req

commit 53ab6709b4d35b1924240854d794482fd7d33d4a upstream.

This patch fixes two bugs wrt to the interrupt context usage of target
core with HW target mode drivers.  It first converts the usage of struct
se_device->stats_lock in transport_get_lun_for_cmd() and core_tmr_lun_reset()
to properly use spin_lock_irq() to address an BUG with CONFIG_LOCKDEP_SUPPORT=y
enabled.

This patch also adds a 'in_interrupt()' check to allow GFP_ATOMIC usage from
core_tmr_alloc_req() to fix a 'sleeping in interrupt context' BUG with HW
target fabrics that require this logic to function.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/target/target_core_device.c
drivers/target/target_core_tmr.c