diff options
Diffstat (limited to 'xlators')
| -rw-r--r-- | xlators/protocol/server/src/server-handshake.c | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/server-handshake.c b/xlators/protocol/server/src/server-handshake.c index 64267f2aef9..f00804a3d3a 100644 --- a/xlators/protocol/server/src/server-handshake.c +++ b/xlators/protocol/server/src/server-handshake.c @@ -412,7 +412,7 @@ server_setvolume (rpcsvc_request_t *req)          rpc_transport_t     *xprt          = NULL;          int32_t              fop_version   = 0;          int32_t              mgmt_version  = 0; - +        glusterfs_ctx_t     *ctx           = NULL;          params = dict_new ();          reply  = dict_new (); @@ -423,6 +423,7 @@ server_setvolume (rpcsvc_request_t *req)                  req->rpc_err = GARBAGE_ARGS;                  goto fail;          } +        ctx = THIS->ctx;          this = req->svc->xl;          /* this is to ensure config_params is populated with the first brick @@ -468,7 +469,11 @@ server_setvolume (rpcsvc_request_t *req)                  goto fail;          } -        xl = get_xlator_by_name (this, name); +        LOCK (&ctx->volfile_lock); +        { +                xl = get_xlator_by_name (this, name); +        } +        UNLOCK (&ctx->volfile_lock);          if (xl == NULL) {                  ret = gf_asprintf (&msg, "remote-subvolume \"%s\" is not found",                                     name);  | 
