target: fix __transport_register_session locking
PATCH 3/15 target: fix __transport_register_session locking
When __transport_register_session is called from transport_register_session irqs will already have been disabled, so we do not want the unlock irq call to enable them until the higher level has done the final spin_unlock_irqrestore/spin_unlock_irq.
This has __transport_register_session use the save/restore call.
--- drivers/target/target_core_transport.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/target/target_core_transport.c +3 -2
@@ -347,6 +347,7 @@ void __transport_register_session( {const struct target_core_fabric_ops *tfo = se_tpg->se_tpg_tfo;unsigned char buf[PR_REG_ISID_LEN ]; +unsigned long flags; se_sess->se_tpg = se_tpg; se_sess->fabric_sess_ptr = fabric_sess_ptr;
@@ -384,7 +385,7 @@ void __transport_register_session(WARN_ON (hex2bin ((u8 *)&se_sess->sess_bin_isid, buf,6 )); } -spin_lock_irq (&se_nacl->nacl_sess_lock); +spin_lock_irqsave (&se_nacl->nacl_sess_lock, flags);/* * The se_nacl->nacl_sess pointer will be set to the * last active I_T Nexus for each struct se_node_acl.
@@ -393,7 +394,7 @@ void __transport_register_session(list_add_tail (&se_sess->sess_acl_list, &se_nacl->acl_sess_list); -spin_unlock_irq (&se_nacl->nacl_sess_lock); +spin_unlock_irqrestore (&se_nacl->nacl_sess_lock, flags); }list_add_tail (&se_sess->sess_list, &se_tpg->tpg_sess_list);
Signature · 1 line
2.7.2
On Sun, 2018-07-15 at 18:16 -0500, Mike Christie wrote:
+AD4- When +AF8AXw-transport+AF8-register+AF8-session is called from +AD4- transport+AF8-register+AF8-session irqs will already have been disabled, +AD4- so we do not want the unlock irq call to enable them until +AD4- the higher level has done the final
+AD4- spin+AF8-unlock+AF8-irqrestore/spin+AF8-unlock+AF8-irq. +AD4-
+AD4- This has +AF8AXw-transport+AF8-register+AF8-session use the save/restore +AD4- call.
Quoted 5 lines · Mike Christie
When
__transport_register_sessionis called fromtransport_register_sessionirqs will already have been disabled, so we do not want the unlock irq call to enable them until the higher level has done the final spin_unlock_irqrestore/spin_unlock_irq.
if you use up your line length this could be:
so we do not want the unlock irq call to enable them until the higher level has done the final spin_unlock_irqrestore/spin_unlock_irq.
Quoted 3 lines
This has
__transport_register_sessionuse the save/restore call.
Can be condensed as well.
Otherwise looks good: