diff options
author | Bart Van Assche <bart.vanassche@sandisk.com> | 2015-02-12 05:48:49 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-03-20 02:15:14 -0400 |
commit | 2f450cc1fbe9713f79b217e61ab204e263723ead (patch) | |
tree | bc5d1feeff6d4ff0511ab5a5798bdc88acf29caa /drivers/vhost/scsi.c | |
parent | 75c3d0bf9caebb502e96683b2bc37f9692437e68 (diff) |
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>
Diffstat (limited to 'drivers/vhost/scsi.c')
-rw-r--r-- | drivers/vhost/scsi.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 8d4f3f1ff799..71df240a467a 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -1956,10 +1956,9 @@ static int vhost_scsi_make_nexus(struct vhost_scsi_tpg *tpg, | |||
1956 | goto out; | 1956 | goto out; |
1957 | } | 1957 | } |
1958 | /* | 1958 | /* |
1959 | * Now register the TCM vhost virtual I_T Nexus as active with the | 1959 | * Now register the TCM vhost virtual I_T Nexus as active. |
1960 | * call to __transport_register_session() | ||
1961 | */ | 1960 | */ |
1962 | __transport_register_session(se_tpg, tv_nexus->tvn_se_sess->se_node_acl, | 1961 | transport_register_session(se_tpg, tv_nexus->tvn_se_sess->se_node_acl, |
1963 | tv_nexus->tvn_se_sess, tv_nexus); | 1962 | tv_nexus->tvn_se_sess, tv_nexus); |
1964 | tpg->tpg_nexus = tv_nexus; | 1963 | tpg->tpg_nexus = tv_nexus; |
1965 | 1964 | ||