]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
FBSD: StopListener glocking fixup
authorBen Kaduk <kaduk@mit.edu>
Sun, 19 Dec 2010 05:06:13 +0000 (00:06 -0500)
committerDerrick Brashear <shadow@dementia.org>
Mon, 10 Jan 2011 20:26:34 +0000 (12:26 -0800)
afs_osi_Sleep requires the glock (so that it can sleep on it); we
dropped the glock earlier in osi_StopListener because soshutdown and
soclose can sleep, but we must (unconditionally!) acquire it for our
loop waiting on rxk_ListenerPid.

Change-Id: Ibea3da2c5d18a2609989b547a1c587c25e3f07ff
Reviewed-on: http://gerrit.openafs.org/3549
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 28032bc1c1aaa4c25e94025a8fa9e2b4e8131ce3)
Reviewed-on: http://gerrit.openafs.org/3633

src/rx/FBSD/rx_knet.c

index 5cb6956827ae2851b27d36d4f93d54f1a8815e03..c6d2d842dfe8d56aa48be61b834d87bc9d59d5f0 100644 (file)
@@ -108,11 +108,14 @@ osi_StopListener(void)
     bzero(&dvec, sizeof(dvec));
     dvec.iov_base = &c;
     dvec.iov_len = 1;
+    /* afs_osi_Sleep requires the GLOCK */
+    AFS_GLOCK();
     while(rxk_ListenerPid) {
        afs_warn("waiting for rxk_ListenerPid to die\n");
        osi_NetSend(rx_socket, &taddr, &dvec, 1, 1, 0);
        afs_osi_Sleep(&rxk_ListenerPid);
     }
+    AFS_GUNLOCK();
     /* in theory, we are now the only people doing anything with rx_socket */
     soclose(rx_socket);