Subject: Re: device busy upon mount
To: Zafer Aydogan <zafer@aydogan.de>
From: Antti Kantee <pooka@cs.hut.fi>
List: tech-kern
Date: 09/08/2007 15:59:29
On Fri Sep 07 2007 at 14:25:48 +0200, Zafer Aydogan wrote:
> Yes, 4.99.28 is affected. The last working version I remember is 4.99.20.
> Must have happened inbetween.
>
> Is it possible that the problem occurs if the kernel is compiled with
> debug/lockdebug ?

Ah, ok, I found the problem.  The real problem, I guess, is that device
nodes on layered file systems don't appear to really work.

When a layered vnode is initialized, it has a special specinfo structure
allocated for it.  The specmountpoint field, which is causing EBUSY
to be returned, is uninitialized memory (deadbeef on a debug kernel),
so this is clearly wrong.  If I initialize it to NULL to allow mount to
proceed, I get a panic at unmount for dangling buffers.

Another point is that layered vnodes don't appear to be considered
aliases, although I think they should; at least in the sense that they
should share specinfo with all the other nodes in the stack.

All this needs a bit more than my next 5min timeslice.  For now the best
solution is to not null-mount /dev and e.g. mount a second tmpfs for it.

-- 
Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
http://www.iki.fi/pooka/                          http://www.NetBSD.org/
    "la qualité la plus indispensable du cuisinier est l'exactitude"