nfsv4: fix multithreading mutex

master
heitbaum 2022-01-28 23:21:34 +00:00
parent a48f019e05
commit 26133258fd
1 changed files with 6 additions and 2 deletions

View File

@ -1687,10 +1687,14 @@ nfs4_chdir_1_cb(struct rpc_context *rpc, int status, void *command_data,
}
/* Ok, all good. Lets steal the path string. */
#ifdef HAVE_MULTITHREADING
nfs_mt_mutex_lock(&nfs->rpc->rpc_mutex);
#endif
free(nfs->nfsi->cwd);
nfs->nfsi->cwd = data->path;
#ifdef HAVE_MULTITHREADING
nfs_mt_mutex_unlock(&nfs->rpc->rpc_mutex);
#endif
data->path = NULL;
@ -2347,10 +2351,10 @@ nfs4_open_readlink_cb(struct rpc_context *rpc, int status, void *command_data,
#ifdef HAVE_MULTITHREADING
nfs_mt_mutex_lock(&data->nfs->nfsi->nfs4_open_mutex);
#endif
data->lock_owner = nfs->nfsi->open_counter++;
#ifdef HAVE_MULTITHREADING
nfs_mt_mutex_unlock(&data->nfs->nfsi->nfs4_open_mutex);
#else
data->lock_owner = nfs->nfsi->open_counter++;
#endif
data->filler.func = nfs4_populate_open;