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

Derek Atkins warlord@MIT.EDU
16 Jan 2001 09:55:46 -0500


Michael Pronath <michael.pronath@gmx.de> writes:

> > What happens, as best I can tell, is that we signal the listener, which
> > is sitting in wait_for_packet, and then we close the socket while still
> > in wait_for_packet, which oopses because we cleared its locked
> > structure out from under it.  I couldn't figure out the appropriate
> > lock we should be holding; we may need to invent a new one.

Doesn't matter about SMP -- you're still running in different kernel
threads.  Remember that afsd forks itself and calls into the kernel
with each fork.  So you do have multiple threads even though you are
running a UP system.

Basically, you need to have a flag that waits for the RxListener
to actually shutdown before it continues.  This could be done via
a global variable.  Somewhere in the code, put:

int listener_shutdown = 0;

In the main shutdown code, put a loop:

	while (!listener_shutdown);

And then at the end of the RxListener, just before it exits, put

	listener_shutdown = 1;

This should solve the problem.

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available