summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdiskfs/io-reauthenticate.c3
-rw-r--r--libnetfs/io-reauthenticate.c3
-rw-r--r--pfinet/io-ops.c3
3 files changed, 9 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);
diff --git a/libnetfs/io-reauthenticate.c b/libnetfs/io-reauthenticate.c
index 1d2d935a..f4f50d52 100644
--- a/libnetfs/io-reauthenticate.c
+++ b/libnetfs/io-reauthenticate.c
@@ -37,8 +37,11 @@ netfs_S_io_reauthenticate (struct protid *user, mach_port_t rend_port)
newright = ports_get_send_right (newpi);
assert (newright != MACH_PORT_NULL);
+ /* Release the node lock while blocking on the auth server and client. */
+ pthread_mutex_unlock (&user->po->np->lock);
err = iohelp_reauth (&newpi->user, netfs_auth_server_port, rend_port,
newright, 1);
+ pthread_mutex_lock (&user->po->np->lock);
mach_port_deallocate (mach_task_self (), rend_port);
mach_port_deallocate (mach_task_self (), newright);
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);