loop/usb/vhost-scsi/xen-scsiback: Fix use of __transport_register_session
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 12 Feb 2015 10:48:49 +0000 (11:48 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 20 Mar 2015 06:15:14 +0000 (23:15 -0700)
commit2f450cc1fbe9713f79b217e61ab204e263723ead
treebc5d1feeff6d4ff0511ab5a5798bdc88acf29caa
parent75c3d0bf9caebb502e96683b2bc37f9692437e68
loop/usb/vhost-scsi/xen-scsiback: Fix use of __transport_register_session

This patch changes loopback, usb-gadget, vhost-scsi and xen-scsiback
fabric code to invoke transport_register_session() instead of the
unprotected flavour, to ensure se_tpg->session_lock is taken when
adding new session list nodes to se_tpg->tpg_sess_list.

Note that since these four fabric drivers already hold their own
internal TPG mutexes when accessing se_tpg->tpg_sess_list, and
consist of a single se_session created through configfs attribute
access, no list corruption can currently occur.

So for correctness sake, go ahead and use the se_tpg->session_lock
protected version for these four fabric drivers.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/loopback/tcm_loop.c
drivers/usb/gadget/legacy/tcm_usb_gadget.c
drivers/vhost/scsi.c
drivers/xen/xen-scsiback.c