Subject: VFS LKMs & pool_init() panic
To: None <>
From: Jaromir Dolecek <>
List: tech-kern
Date: 03/11/2000 17:10:00
I've had occasional panics (kernel traps) when I've loaded and
unloaded a msdosfs LKM several times.

I've finally nailed the problem down to these few lines in pool_init()

	/* Insert into the list of all pools. */
	TAILQ_INSERT_TAIL(&pool_head, pp, pr_poollist);

After I changed msdosfs's lkminit_vfs.c to call pool_destroy() on
it's pool before the fs is detached, everything is fine and I had
no more panics from that point on.

The problem here is that a LKM is unloaded, it doesn't have a chance
to free it's resources. Besides wasting memory on every load/unload,
this may leave dangling pointers in the list of pools or whatever.

Solutions would be to add a new VFS routine, say vfs_done,
which would be called from vfs_detach() - so that each
filesystem would have a chance to clean up whatever it needs,
before it's unloaded.

Opinions ? Anyone has any strong argument against it ?
The change would be pretty streightforward. I'd like to
implement it very soon (definitely before 1.5), as this would
break LKM binary compatibility again.

Jaromir Dolecek <>
@@@@  Wanna a real operating system ? Go and get NetBSD, damn!  @@@@