Subject: Re: vnode locking procedure change to suport stacked fs's.
To: Bill Studenmund <>
From: Konrad Schroder <>
List: tech-kern
Date: 05/24/1999 17:22:51
On Mon, 24 May 1999, Bill Studenmund wrote:

> To do this, I'll add a struct lock to struct vnode, and have a genfs_lock,
> genfs_unlock, and genfs_islocked which would actually use the struct lock
> * in the vnode. vget would make sure that the struct lock * pointed to
> that vnode's struct lock when it gets pulled off of the free list.
> nullfs & umapfs would then just point the struct lock * in the upper node
> to the lock in the lower node. I think for unionfs, the union lock should
> point to the upper vndoe if present, and the lower vnode otherwise.

Ideally one would have some kind of watchdog mechanism by which the lower
vnode in a vnode stack would call VOPs on the upper vnode, if it was
requested, like a watchdog.  Currently the lower vnode has no way of
knowing whether any upper vnodes exist.

The particular problem I have in mind is that of a vnode referenced only
by a stacked vnode being removed: both lower and upper vnodes hang around
until they float up to the top of the vnode free list, when really they
should be recycled immediately.  Also, if portalfs can be made to work
(does it? I haven't tried), this could give us real, user-space watchdogs.

(Admittedly these issues are rather less important than the locking
problems of umap/null/unionfs, for which making the locks identical seems
an elegant solution indeed.)

Konrad Schroder
System Administrator              
Human Interface Technology Lab                    Voice: +1.206.616.1478
Box 352142, University of Washington, 98195, USA    FAX: +1.206.543.5380