Subject: Re: CVS commit: src
To: None <tech-kern@netbsd.org>
From: Juergen Hannken-Illjes <hannken@netbsd.org>
List: tech-kern
Date: 06/21/2004 12:05:23
On Mon, Jun 21, 2004 at 09:09:10AM +0900, YAMAMOTO Takashi wrote:
> > > i think that having some tricks in VOP_LOCK/UNLOCK/ISLOCKED is enough.
> > > (in addition to stopping exporting v_vnlock, of course.)
> > 
> > What "tricks" could merge locks A and B into B?
> 
> something like this:
> 	ffs_lock(...)
> 	{
> 
> 		genfs_lock(vp, ...);
> 		if (vp is snapshot) {
> 			lockmgr(snaplk, ...);
> 		}
> 	}

This does't address the problem:

  During snapshot construction there is a point where we need to go
  from "normal" vnode lock to "snapshot" vnode lock. Here the vnode is
  (and must remain) locked and may have waiters. To make the situation
  worse, the file system is currently suspended.

  If the "lockmgr(snaplk, ...);" has to wait -> deadlock.

-- 
Jürgen Hannken-Illjes - hannken@netbsd.org