diff mbox series

[24/34] lnet: don't take lock over lnet_net_unique()

Message ID 153628137220.8267.9479780300443400770.stgit@noble (mailing list archive)
State New, archived
Headers show
Series Beginning of multi-rail support for drivers/staging/lustre | expand

Commit Message

NeilBrown Sept. 7, 2018, 12:49 a.m. UTC
holding ln_api_mutex is enough to keep the list
stable.

This is part of
    8cbb8cd3e771e7f7e0f99cafc19fad32770dc015
       LU-7734 lnet: Multi-Rail local NI split

Signed-off-by: NeilBrown <neilb@suse.com>
---
 drivers/staging/lustre/lnet/lnet/api-ni.c |    2 --
 1 file changed, 2 deletions(-)

Comments

Doug Oucharek Sept. 12, 2018, 4:29 a.m. UTC | #1
Reviewed-by: Doug Oucharek <dougso@me.com>

Doug

On 9/6/18, 5:54 PM, "NeilBrown" <neilb@suse.com> wrote:

    holding ln_api_mutex is enough to keep the list
    stable.
    
    This is part of
        8cbb8cd3e771e7f7e0f99cafc19fad32770dc015
           LU-7734 lnet: Multi-Rail local NI split
    
    Signed-off-by: NeilBrown <neilb@suse.com>
    ---
     drivers/staging/lustre/lnet/lnet/api-ni.c |    2 --
     1 file changed, 2 deletions(-)
    
    diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
    index 42e775e2a669..2b5c25a1dc7c 100644
    --- a/drivers/staging/lustre/lnet/lnet/api-ni.c
    +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
    @@ -1372,9 +1372,7 @@ lnet_startup_lndnet(struct lnet_net *net, struct lnet_lnd_tunables *tun)
     	LASSERT(libcfs_isknown_lnd(lnd_type));
     
     	/* Make sure this new NI is unique. */
    -	lnet_net_lock(LNET_LOCK_EX);
     	rc = lnet_net_unique(net->net_id, &the_lnet.ln_nets);
    -	lnet_net_unlock(LNET_LOCK_EX);
     	if (!rc) {
     		if (lnd_type == LOLND) {
     			lnet_net_free(net);
diff mbox series

Patch

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 42e775e2a669..2b5c25a1dc7c 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -1372,9 +1372,7 @@  lnet_startup_lndnet(struct lnet_net *net, struct lnet_lnd_tunables *tun)
 	LASSERT(libcfs_isknown_lnd(lnd_type));
 
 	/* Make sure this new NI is unique. */
-	lnet_net_lock(LNET_LOCK_EX);
 	rc = lnet_net_unique(net->net_id, &the_lnet.ln_nets);
-	lnet_net_unlock(LNET_LOCK_EX);
 	if (!rc) {
 		if (lnd_type == LOLND) {
 			lnet_net_free(net);