Subject: Re: split LFS vnode locks
To: None <wrstuden@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 12/16/2002 10:07:26
> > currently, since lfs_markv have to acquire vnode locks,
> > lfs_reserve have to release vnode locks before wait for lfs_avail.
> > however, releasing locks in lfs_reserve isn't safe because
> > we can't keep the vnodes/inodees from modifying without holding the locks.
> 
> That's something you have to live with. If you have to sleep, you have to
> be ready for the world to have changed when you wake up.
> 
> > i'd like to separate metadata (ie. block pointers) lock from vnode lock
> > so that lfs_reserve no longer need to release vnode locks as attached patch.
> > is it ok?
> 
> I don't know enough about lfs to understand exactly the problem, but I
> think this won't work.
> 
> You CAN NOT sleep with a vnode lock held.
> 
> lfs_reserve() calls tsleep, thus it MUST unlock the vnode.
> 
> There is no way around it.

mmmm, ok, i see.
then, probably we have to have way to restart vnode ops from
namei lookup instead because we can't continue vnode ops safely
after we release vnode locks once.  right?

VOP_RESERVE can be an alternative, but anyway,
i should modify vnodeop i/f only for lfs.
that's what i wanted to avoid... :-)

YAMAMOTO Takashi