target: Make transport_lookup_cmd_lun() locking IRQ-safe
authorRoland Dreier <roland@purestorage.com>
Wed, 20 Jul 2011 09:09:10 +0000 (09:09 +0000)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 22 Jul 2011 09:37:45 +0000 (09:37 +0000)
commit78faae37897dc2a9ccc7c19155294a4bfdcae077
tree36db87c44506bd34da1d21633dbfe1e59de40910
parent07bde79a5c355dbca66ca4318645aa17b4c0d859
target: Make transport_lookup_cmd_lun() locking IRQ-safe

transport_lookup_cmd_lun() may be called from interrupt context (eg
tcm_loop_allocate_core_cmd() calls it, and it has a comment that says,
"Can be called from interrupt context"), so it needs to use
spin_lock_irqsave() instead of spin_lock_irq() to avoid enabling
interrupts at the wrong time.

(And indeed the last set of lock operations, on lun_cmd_lock, were
already using spin_lock_irqsave(), so we just need to fix the other
two locks we take)

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_device.c