Subject: Re: VOP locking issue
To: Manuel Bouyer <email@example.com>
From: Antti Kantee <firstname.lastname@example.org>
Date: 11/13/2006 22:46:23
[let's try to include the list this time]
On Sun Nov 12 2006 at 22:33:38 +0100, Manuel Bouyer wrote:
> This maps to this code in xbdback_xenbus.c (with error handling removed for
> better reading)
> err = bdevvp(xbdi->xbdi_dev, &xbdi->xbdi_vp);
> err = VOP_OPEN(xbdi->xbdi_vp, FREAD, NOCRED, 0);
> VOP_UNLOCK(xbdi->xbdi_vp, 0);
> I suspect the block device opened here was also open in userland
> (by the qemu-dm process). It's also possible that it was mounted.
> Does anyone have an idea if this is the problem, and if it can be avoided ?
My theory: I suspect that checkalias() matches in bdevvp(), so you
get a vnode which actually supports locking (pure specfs does not).
Now, bdevvp() returns an unlocked vnode, so you should call vn_lock()
before calling VOP_OPEN() to be correct.
Antti Kantee <email@example.com> Of course he runs NetBSD
"la qualité la plus indispensable du cuisinier est l'exactitude"