• Roland Dreier's avatar
    target: Make locking in transport_deregister_session() IRQ safe · e63a8e19
    Roland Dreier authored
    At least the tcm_qla2xxx fabric driver calls into transport_deregister_session()
    while holding an IRQ-disabled spinlock, so the inner locking needs to
    use spin_lock_irqsave() instead of spin_lock_bh().
    
    This fixes warnings seen with tcm_qla2xxx like:
    
        WARNING: at kernel/softirq.c:159 local_bh_enable_ip+0x98/0xb0()
        Call Trace:
         [<ffffffff8104e65f>] warn_slowpath_common+0x7f/0xc0
         [<ffffffff8104e6ba>] warn_slowpath_null+0x1a/0x20
         [<ffffffff81055368>] local_bh_enable_ip+0x98/0xb0
         [<ffffffff814d5284>] _raw_spin_unlock_bh+0x14/0x20
         [<ffffffffa027b7f6>] transport_deregister_session+0x96/0x180 [target_core_mod]
         [<ffffffffa00f7731>] tcm_qla2xxx_free_session+0xd1/0x170 [tcm_qla2xxx]
         [<ffffffffa01b9173>] qla_tgt_sess_put+0xc3/0x140 [qla2xxx]
         [<ffffffffa01bf40f>] qla_tgt_stop_phase1+0x8f/0x2c0 [qla2xxx]
         [<ffffffffa00f735e>] tcm_qla2xxx_tpg_store_enable+0x6e/0xd0 [tcm_qla2xxx]
         [<ffffffffa026ca29>] target_fabric_tpg_attr_store+0x39/0x40 [target_core_mod]
         [<ffffffffa00a575d>] configfs_write_file+0xbd/0x120 [configfs]
         [<ffffffff811464a6>] vfs_write+0xc6/0x180
         [<ffffffff811467c1>] sys_write+0x51/0x90
         [<ffffffff814dd382>] system_call_fastpath+0x16/0x1b
    Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    e63a8e19
target_core_transport.c 143 KB