Due to the patches "loop/usb/vhost-scsi/xen-scsiback: Fix use of __transport_register_session" and "tcm_qla2xxx: Fix incorrect use of __transport_register_session" all __transport_register_session() callers hold se_tpg->session_lock. This makes it possible to convert the source code comment above __transport_register_session() into a runtime check. Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Andy Grover <agrover@xxxxxxxxxx> --- drivers/target/target_core_transport.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 57df213..4177b01 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -313,9 +313,6 @@ struct se_session *transport_init_session_tags(unsigned int tag_num, } EXPORT_SYMBOL(transport_init_session_tags); -/* - * Called with spin_lock_irqsave(&struct se_portal_group->session_lock called. - */ void __transport_register_session( struct se_portal_group *se_tpg, struct se_node_acl *se_nacl, @@ -325,6 +322,8 @@ void __transport_register_session( const struct target_core_fabric_ops *tfo = se_tpg->se_tpg_tfo; unsigned char buf[PR_REG_ISID_LEN]; + lockdep_assert_held(&se_tpg->session_lock); + se_sess->se_tpg = se_tpg; se_sess->fabric_sess_ptr = fabric_sess_ptr; /* -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html