summaryrefslogtreecommitdiff
path: root/libdiskfs/io-reauthenticate.c
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 /libdiskfs/io-reauthenticate.c
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 'libdiskfs/io-reauthenticate.c')
-rw-r--r--libdiskfs/io-reauthenticate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdiskfs/io-reauthenticate.c b/libdiskfs/io-reauthenticate.c
index 649315f7..985db498 100644
--- a/libdiskfs/io-reauthenticate.c
+++ b/libdiskfs/io-reauthenticate.c
@@ -49,8 +49,11 @@ diskfs_S_io_reauthenticate (struct protid *cred,
newright = ports_get_send_right (newcred);
assert (newright != MACH_PORT_NULL);
+ /* Release the node lock while blocking on the auth server and client. */
+ pthread_mutex_unlock (&cred->po->np->lock);
err = iohelp_reauth (&user, diskfs_auth_server_port, rend_port,
newright, 1);
+ pthread_mutex_lock (&cred->po->np->lock);
if (! err)
{
diskfs_finish_protid (newcred, user);