[OpenAFS-devel] Kernel 2.4.0 Oops when afs is shutting down

Michael Pronath michael.pronath@gmx.de
Wed, 17 Jan 2001 12:37:28 +0100


On Tue, Jan 16, 2001 at 12:24:28PM -0500, Derek Atkins wrote:
> Michael Pronath <michael.pronath@gmx.de> writes:
> 
> > Now it doesn't oops anymore, but it hangs.  
> > Michael
> 
> Where does it hang?  What is the last kernel message that you see?  I
> presume you see "RxEvent..." but you never see "RxListener..."?  Or do
> you actually see "RxListener..." and it hangs there?  If the latter,
> then can you revert the last change and make this one in the file
> rx/LINUX/rx_knet.c, at the bottom of the file, make it read:
> 
>     if (rx_socket != NULL)
>         sock_release(rx_socket);
>     rx_socket = NULL;
> 
> -derek

I think it was RxListener... but I'm not sure anymore.  rx_socket is always
!= NULL here.  I inserted an afs_warn before the sock_release giving me the
address, and it was never 0.
 
I tried the proposal of Chas Williams (spinning on rxk_ListenerPid before
removing the socket), and that did it.  I changed
    if (rxk_ListenerPid) {
        (void) (*sys_killp)(rxk_ListenerPid, 9);
        rxk_ListenerPid = 0;                     //    <----
    }
    sock_release(rx_socket);
to 
    if (rxk_ListenerPid) {
        (void) (*sys_killp)(rxk_ListenerPid, 9);
        afs_osi_Sleep(&rxk_ListenerPid);         //    <----
    }
    sock_release(rx_socket);

and introduced a call to afs_osi_Wakeup(&rxk_ListenerPid) in rx_kcommon.c
after rxk_ListenerPid=0.  Is this ok with regard to the locks?

A patch file is:

diff -Naur openafs-1.0.1/src/rx/LINUX/rx_knet.c openafs-1.0.1-patched/src/rx/LINUX/rx_knet.c
--- openafs-1.0.1/src/rx/LINUX/rx_knet.c	Sun Nov  5 21:04:18 2000
+++ openafs-1.0.1-patched/src/rx/LINUX/rx_knet.c	Wed Jan 17 11:33:27 2001
@@ -176,7 +176,7 @@
 
     if (rxk_ListenerPid) {
 	(void) (*sys_killp)(rxk_ListenerPid, 9);
-	rxk_ListenerPid = 0;
+	afs_osi_Sleep(&rxk_ListenerPid);
     }
     sock_release(rx_socket);
     rx_socket = NULL;
diff -Naur openafs-1.0.1/src/rx/rx_kcommon.c openafs-1.0.1-patched/src/rx/rx_kcommon.c
--- openafs-1.0.1/src/rx/rx_kcommon.c	Sat Nov  4 11:05:31 2000
+++ openafs-1.0.1-patched/src/rx/rx_kcommon.c	Wed Jan 17 11:33:04 2001
@@ -969,6 +969,7 @@
 	afs_osi_Wakeup(&afs_termState);
     }
     rxk_ListenerPid = 0;
+    afs_osi_Wakeup(&rxk_ListenerPid);
 #ifdef AFS_SUN5_ENV
     AFS_GUNLOCK();
 #endif /* AFS_SUN5_ENV */
 


-- 

Dipl.-Ing. Michael Pronath
Lehrstuhl fuer Entwurfsautomatisierung            Tel:  +49 89 289 23659
Technische Universitaet Muenchen                  Fax:  +49 89 289 63666
Arcisstr.21, D-80333 Muenchen         TU-Innenhof, Gebaeude 9, Raum 4915
Mailto:Michael.Pronath@ei.tum.de