[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 14/15: Do not keep mutex locked while waiting for authenticate lo
From: |
Samuel Thibault |
Subject: |
[hurd] 14/15: Do not keep mutex locked while waiting for authenticate loop |
Date: |
Sun, 05 Jul 2015 00:42:01 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit be0a34cf05c1bcbb119d91a74be44ee837861426
Author: Samuel Thibault <address@hidden>
Date: Sat Jul 4 23:29:46 2015 +0200
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.
---
libdiskfs/io-reauthenticate.c | 3 +++
libnetfs/io-reauthenticate.c | 3 +++
pfinet/io-ops.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/libdiskfs/io-reauthenticate.c b/libdiskfs/io-reauthenticate.c
index 649315f..985db49 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 1d2d935..f4f50d5 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 cc666cd..742d64f 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);
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 09/15: libdiskfs: do not print a message on ENOMEM, (continued)
- [hurd] 09/15: libdiskfs: do not print a message on ENOMEM, Samuel Thibault, 2015/07/04
- [hurd] 15/15: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2015/07/04
- [hurd] 08/15: Check AWK usability when XKB is enabled, Samuel Thibault, 2015/07/04
- [hurd] 07/15: console-client: Fix lower range of binary search, Samuel Thibault, 2015/07/04
- [hurd] 04/15: utils/rpctrace: fix build with -O0, Samuel Thibault, 2015/07/04
- [hurd] 06/15: console-client: assert precondition, Samuel Thibault, 2015/07/04
- [hurd] 05/15: utils/vmstat: fix integer overflow, Samuel Thibault, 2015/07/04
- [hurd] 03/15: console-client: fix binary search, Samuel Thibault, 2015/07/04
- [hurd] 11/15: Cope with scripts which chmod -x directories, Samuel Thibault, 2015/07/04
- [hurd] 10/15: Fix ps -o %r infinite loop, Samuel Thibault, 2015/07/04
- [hurd] 14/15: Do not keep mutex locked while waiting for authenticate loop,
Samuel Thibault <=
- [hurd] 13/15: utils/rpcscan: new utility, Samuel Thibault, 2015/07/04
- [hurd] 12/15: utils: split-off the message id parsing, Samuel Thibault, 2015/07/04