summaryrefslogtreecommitdiff
path: root/pfinet
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-07-04 23:29:46 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-07-04 23:30:59 +0200
commitbe0a34cf05c1bcbb119d91a74be44ee837861426 (patch)
treea474d9129fcca6713bf9b8620125077f6b0f2d87 /pfinet
parent64f99d303557e991149bd2d4e6085e9f46efb3ef (diff)
Do not keep mutex locked while waiting for authenticate loop
* libdiskfs/io-reauthenticate.c (diskfs_S_io_reauthenticate): Release the node lock while blocking on the auth server and client. * libnetfs/io-reauthenticate.c (netfs_S_io_reauthenticate): Likewise. * pfinet/io-ops.c (S_io_reauthenticate): Likewise.
Diffstat (limited to 'pfinet')
-rw-r--r--pfinet/io-ops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c
index cc666cd6..742d64ff 100644
--- a/pfinet/io-ops.c
+++ b/pfinet/io-ops.c
@@ -379,6 +379,8 @@ S_io_reauthenticate (struct sock_user *user,
auth = getauth ();
newright = ports_get_send_right (newuser);
assert (newright != MACH_PORT_NULL);
+ /* Release the global lock while blocking on the auth server and client. */
+ pthread_mutex_unlock (&global_lock);
do
err = auth_server_authenticate (auth,
rend,
@@ -390,6 +392,7 @@ S_io_reauthenticate (struct sock_user *user,
&gen_gids, &gengidlen,
&aux_gids, &auxgidlen);
while (err == EINTR);
+ pthread_mutex_lock (&global_lock);
mach_port_deallocate (mach_task_self (), rend);
mach_port_deallocate (mach_task_self (), newright);
mach_port_deallocate (mach_task_self (), auth);