NetBSD Problem Report #32535

From bouyer@antioche.lip6.fr  Thu Jan  5 12:33:19 2006
Return-Path: <bouyer@antioche.lip6.fr>
Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2])
	by narn.netbsd.org (Postfix) with ESMTP id 5303C63BA88
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  5 Jan 2006 12:33:18 +0000 (UTC)
Message-Id: <200601051233.k05CXGb0008595@antioche.lip6.fr>
Date: Thu, 5 Jan 2006 13:33:16 +0100 (MET)
From: bouyer@antioche.eu.org (Manuel Bouyer)
Reply-To: bouyer@antioche.eu.org (Manuel Bouyer)
To: gnats-bugs@netbsd.org
Subject: processes stuck on vnlock (hang, nullfs, layerfs)
X-Send-Pr-Version: 3.95

>Number:         32535
>Category:       kern
>Synopsis:       processes stuck on vnlock (hang, nullfs, layerfs)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    chs
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 15 12:09:40 +0000 2006
>Closed-Date:    Thu Jan 31 14:34:02 +0000 2008
>Last-Modified:  Thu Jan 31 14:34:02 +0000 2008
>Originator:     Manuel Bouyer
>Release:        NetBSD 3.0_RC3
>Organization:
LIP6, Universite Paris 6
>Environment:
System: NetBSD antioche.lip6.fr 3.0_RC3 NetBSD 3.0_RC3 (ANTIOCHE.MP) #2: Fri Nov 25 12:28:11 CET 2005 bouyer@pop.lip6.fr:/local/pop1/bouyer/tmp/i386/obj/local/pop1/bouyer/netbsd-3/src/sys/arch/i386/compile/ANTIOCHE.MP i386
Architecture: i386
Machine: i386, dual-CPU PIII system
>Description:
	This is on the french mirror system. It has several disk mounted,
	with null mounts to make all of them appear under ~ftp/pub:
/dev/raid0a on / type ffs (local)
/dev/raid1b on /var type ffs (noexec, nodev, local)
/dev/raid1e on /usr type ffs (nodev, local)
/dev/raid2e on /var/mail type ffs (noexec, nodev, local)
/dev/raid1f on /var/tmp type ffs (noexec, nodev, noatime, local)
/dev/raid4e on /home type ffs (nosuid, local)
mfs:1013 on /home/ftp/tmp type mfs (synchronous, noexec, nodev, noatime, local)
/dev/sd8e on /home/ftp/pub type ffs (noexec, nodev, noatime, NFS exported, local)
/dev/ccd2e on /home/ftp2/pub type ffs (noexec, nodev, noatime, NFS exported, local)
/dev/sd12e on /home/ftp3/pub type ffs (noexec, nodev, noatime, local)
/dev/sd9e on /home/ftp4/pub type ffs (noexec, nodev, noatime, local)
/dev/sd26f on /home/ftp5/pub type ffs (noexec, nodev, noatime, local)
/dev/sd28f on /home/ftp6/pub type ffs (noexec, nodev, noatime, local)
/dev/ccd0e on /home/ftp7/pub type ffs (noexec, nodev, noatime, local)
/home/ftp2/pub/NetBSD/packages/1.5 on /home/ftp/pub/NetBSD/packages/1.5 type null (read-only, noexec, nodev, local)
/home/ftp2/pub/NetBSD/packages/1.6.2 on /home/ftp/pub/NetBSD/packages/1.6.2 type null (read-only, noexec, nodev, local)
/home/ftp2/pub/NetBSD/NetBSD-1.6 on /home/ftp/pub/NetBSD/NetBSD-1.6 type null (read-only, noexec, nodev, local)
/home/ftp3/pub/NetBSD/NetBSD-2.0 on /home/ftp/pub/NetBSD/NetBSD-2.0 type null (read-only, noexec, nodev, local)
/home/ftp3/pub/NetBSD/NetBSD-2.0.2 on /home/ftp/pub/NetBSD/NetBSD-2.0.2 type null (read-only, noexec, nodev, local)
/home/ftp3/pub/NetBSD/NetBSD-2.1 on /home/ftp/pub/NetBSD/NetBSD-2.1 type null (read-only, noexec, nodev, local)
/home/ftp3/pub/NetBSD/iso/2.0 on /home/ftp/pub/NetBSD/iso/2.0 type null (read-only, noexec, nodev, local)
/home/ftp3/pub/NetBSD/iso/2.1 on /home/ftp/pub/NetBSD/iso/2.1 type null (read-only, noexec, nodev, local)
/home/ftp5/pub/NetBSD/NetBSD-3.0 on /home/ftp/pub/NetBSD/NetBSD-3.0 type null (read-only, noexec, nodev, local)
/home/ftp5/pub/NetBSD/iso/3.0 on /home/ftp/pub/NetBSD/iso/3.0 type null (read-only, noexec, nodev, local)
/home/ftp5/pub/NetBSD/packages/pkgsrc-2005Q2 on /home/ftp/pub/NetBSD/packages/pkgsrc-2005Q2 type null (read-only, noexec, nodev, local)
/home/ftp6/pub/NetBSD/packages/pkgsrc-2004Q4 on /home/ftp/pub/NetBSD/packages/pkgsrc-2004Q4 type null (read-only, noexec, nodev, local)
/home/ftp6/pub/NetBSD/packages/pkgsrc-2005Q1 on /home/ftp/pub/NetBSD/packages/pkgsrc-2005Q1 type null (read-only, noexec, nodev, local)
/home/ftp6/pub/NetBSD/packages/pkgsrc-2005Q3 on /home/ftp/pub/NetBSD/packages/pkgsrc-2005Q3 type null (read-only, noexec, nodev, local)
/home/ftp7/pub/NetBSD-CVS on /home/ftp/pub/NetBSD-CVS type null (read-only, noexec, nodev, local)
/home/ftp6/pub/NetBSD/NetBSD-1.6.2 on /home/ftp/pub/NetBSD/NetBSD-1.6.2 type null (read-only, noexec, nodev, local)
/home/ftp6/pub/NetBSD/NetBSD-1.5.3 on /home/ftp/pub/NetBSD/NetBSD-1.5.3 type null (read-only, noexec, nodev, local)
/home/ftp4/pub/NetBSD-daily on /home/ftp/pub/NetBSD-daily type null (read-only, noexec, nodev, local)
/home/ftp6/pub/NetBSD/packages/pkgsrc-2005Q4 on /home/ftp/pub/NetBSD/packages/pkgsrc-2005Q4 type null (read-only, noexec, nodev, local)

2 weeks ago, processes trying to access /home/ftp7/pub and
/home/ftp/pub/NetBSD-CVS were all stuck on vnlock. This filesystem only holds
the NetBSD CVS repository for the anoncvs mirror, so lots of filesystem
activity: rsync read/write on /home/ftp7/pub, rsync and CVS read-only on
/home/ftp/pub/NetBSD-CVS.

I have a core dump of the system in this state.

>How-To-Repeat:
	Lots of concurent accesses to a filesystem ? null mounts may be
	required to trigger the problem. Note that this is hard to reproduce,
	I've seen it only once since this system runs the netbsd-3 branch
	(nov 25).
>Fix:
	unknown

>Release-Note:

>Audit-Trail:

From: Chuck Silvers <chuq@chuq.com>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, yamt@netbsd.org
Subject: Re: kern/32535: processes stuck on vnlock
Date: Sun, 15 Jan 2006 10:26:01 -0800

 these two processes are each waiting for a lock that the other is holding:

  9684 cd250000 vnlock   ?      RW   0:30.00 (cvs)
 21343 cd358000 vnlock   ?      RW   0:33.00 (rsync)


 their stack traces are:

 cvs
 (gdb) bt
 #0  0xcd3f829c in ?? ()
 #1  0xc024b1fe in bpendtsleep ()
 #2  0xc0239a4e in acquire ()
 #3  0xc023a217 in lockmgr ()
 #4  0xc0291b50 in layer_lock ()
 #5  0xc028c25b in vn_lock ()
 #6  0xc027fb5c in vrele ()
 #7  0xc027d77f in lookup ()
 #8  0xc027cf7c in namei ()
 #9  0xc0286e38 in sys___stat13 ()
 #10 0xc02de469 in syscall_plain ()


 rsync
 (gdb) bt
 #0  0xcd3f8efc in ?? ()
 #1  0xc024b1fe in bpendtsleep ()
 #2  0xc0239a4e in acquire ()
 #3  0xc023a217 in lockmgr ()
 #4  0xc028d9fb in genfs_lock ()
 #5  0xc028c25b in vn_lock ()
 #6  0xc027ad53 in cache_lookup ()
 #7  0xc02140d4 in ufs_lookup ()
 #8  0xc027d58b in lookup ()
 #9  0xc027cf7c in namei ()
 #10 0xc0286ed8 in sys___lstat13 ()
 #11 0xc02de469 in syscall_plain ()


 it looks like the cvs process is taking locks in the wrong order,
 since it's got the child directory locked and it's trying to lock
 the parent directory in order to call VOP_INACTIVE().  if there
 had been no null mounts involved, this hang wouldn't have happened,
 since the rsync process would have had another reference on the parent
 directory, so vrele() in the cvs process wouldn't have needed to call
 VOP_INACTIVE() on the parent vnode and thus not have needed to lock it
 either.

 yamt's upcoming redesign of the locking for vnode identities might
 prevent this particular problem, but it still seems fundamentally wrong
 that dropping a reference to one vnode would require taking a lock on
 another vnode in the same context.  it would be safer to defer the work
 of releasing the reference on the lower vnode to a worker thread,
 so there won't be any other locks held to cause problems like this.

 -Chuck

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/32535: processes stuck on vnlock
Date: Sun, 15 Jan 2006 19:55:26 +0100

 On Sun, Jan 15, 2006 at 06:30:03PM +0000, Chuck Silvers wrote:
 > 

 I think you already know this, but,

 >  these two processes are each waiting for a lock that the other is holding:
 >  
 >   9684 cd250000 vnlock   ?      RW   0:30.00 (cvs)

 This process is running in the nullfs mount

 >  21343 cd358000 vnlock   ?      RW   0:33.00 (rsync)

 this one is running in the underlying FFSv1 filesystem.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

State-Changed-From-To: open->analyzed
State-Changed-By: chs@netbsd.org
State-Changed-When: Sun, 15 Jan 2006 19:53:34 +0000
State-Changed-Why:
problem is understood


From: Bill Studenmund <wrstuden@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: kern/32535: processes stuck on vnlock
Date: Mon, 25 Sep 2006 18:32:15 -0700

 --at6+YcpfzWZg/htY
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 Ok, here is some more analysis on the problem.

 The main issue is that vrele() can lock the vnode before calling
 VOP_INACTIVE(). Since we are calling vrele() on the parrent and we have
 hte child locked, this locking violates the vnode locking hierarchy; you
 can't lock a vnode's parent while holding the vnode's lock.

 I see three ways to fix this:

 1) Do something along the lines of what I think Chuck was talking about,
 and create a work queue to handle destroying vnodes. The trick, though, is
 that VOP_INACTIVE() isn't necessarily about destroying a vnode, it's
 telling the file system that the vnode is going on the free list. The main
 user of this information (AFAIK) is NFS, which will zap a node if the
 silly-rename code has been triggered.

 We _could_ have a special worker thread do handle the VOP_INACTIVE
 calling, however this will happen every time a vnode gets put on the free
 list! Even if we added a flag so that we only did this processing if
 requested (i.e. some vnodes skipped calling VOP_INACTIVE()), we still have
 this weird case where we have the free list we have now, and we have a
 "freeing" list.

 My main concern is a case where a file system uses VOP_INACTIVE as an
 indication that it can release resources. I expect such a file system will
 want VOP_INACTIVE calls, and this change will result in a performance hit.

 2) We could re-work lookup() so that we don't release the directory lock
 if we're locking the child and we instead call vput(). I think this is the
 best option as it gets rid of the real problem. I'll look into it, but
 if someone else wants to look into this, please do! I'm not sure how
 quickly I can look at it.

 3) We add a vrele2() call that takes the vnode on which we're calling
 vrele() and another vnode that we have locked. It would process just like
 vrele(), except instead of just locking the vnode, it tries to get the
 lock. If it can, it proceeds. If it can't, it releases the other vnode
 then blocks waiting for the first vnode's lock.

 Option 3 probably is the easiest solution. But I'm not sure what I think
 of it.

 Actually, if we did this as a locking primitive (vlock_with_held()), we
 could use it for ".." lookup too. It's the same issue as lookup on ".."...=

 :-)

 Take care,

 Bill




 ----- End forwarded message -----

 --at6+YcpfzWZg/htY
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.3 (NetBSD)

 iD8DBQFFGIMfWz+3JHUci9cRAr1yAJ4lewHllTGPf12psspc8AG7Xky8UACeOOFf
 0Pitq/iiaYY3ivAQ+Her2a8=
 =zEFo
 -----END PGP SIGNATURE-----

 --at6+YcpfzWZg/htY--

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: kern/32535: processes stuck on vnlock
Date: Sat, 7 Oct 2006 12:10:45 +0200

 Note that if someone writes a fix for this I'll be happy to try it.
 I have a box which has to be rebooted -n -q periodically because of
 processes stuck on vnlock. One day I'll change the disk system to get
 rid of the null mounts, which will fix the issue :)

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Chuck Silvers <chuq@chuq.com>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, Manuel Bouyer <bouyer@antioche.eu.org>
Subject: Re: kern/32535: processes stuck on vnlock
Date: Sun, 19 Nov 2006 09:51:43 -0800

 On Tue, Sep 26, 2006 at 01:35:02AM +0000, Bill Studenmund wrote:
 >  2) We could re-work lookup() so that we don't release the directory lock
 >  if we're locking the child and we instead call vput(). I think this is the
 >  best option as it gets rid of the real problem. I'll look into it, but
 >  if someone else wants to look into this, please do! I'm not sure how
 >  quickly I can look at it.


 I've put a diff that implements this at
 ftp://ftp.netbsd.org/pub/NetBSD/misc/chs/lookup/diff.20061119


 details:
  - LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
    these now always return the parent vnode locked.  namei() works as before.
    lookup() and various other paths no longer acquire vnode locks in the
    wrong order via vrele().  this should fix PR 32535.
  - the above allows us to get rid of PDIRUNLOCK.
  - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).

 more things fixed in this patch that I found while testing the above:
  - remove an assumption in layer_node_find() that all file systems implement
    a recursive VOP_LOCK() (unionfs doesn't).
  - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
    fill in eopnotsupp() for file systems that don't support being exported
    and remove the checks for NULL.  (layerfs calls these without checking.)
  - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
    adjust which vnode is locked.  fixes PR 33374.
  - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


 -Chuck

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Chuck Silvers <chuq@chuq.com>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org,
	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/32535: processes stuck on vnlock
Date: Sun, 19 Nov 2006 19:00:06 +0100

 On Sun, Nov 19, 2006 at 09:51:43AM -0800, Chuck Silvers wrote:
 > On Tue, Sep 26, 2006 at 01:35:02AM +0000, Bill Studenmund wrote:
 > >  2) We could re-work lookup() so that we don't release the directory lock
 > >  if we're locking the child and we instead call vput(). I think this is the
 > >  best option as it gets rid of the real problem. I'll look into it, but
 > >  if someone else wants to look into this, please do! I'm not sure how
 > >  quickly I can look at it.
 > 
 > 
 > I've put a diff that implements this at
 > ftp://ftp.netbsd.org/pub/NetBSD/misc/chs/lookup/diff.20061119

 Thanks. How does this relates to the diff sent by Bill on this topic ?
 Is yours in addition to his diff, or does it remplace his diff ?

 Also is it easy to backport this to current ?

 BTW I've not had any problems since ftp.fr.netbsd.org runs with bill's
 patch.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Chuck Silvers <chuq@chuq.com>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org,
	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/32535: processes stuck on vnlock
Date: Sun, 19 Nov 2006 19:41:37 +0100

 On Sun, Nov 19, 2006 at 10:14:57AM -0800, Chuck Silvers wrote:
 > On Sun, Nov 19, 2006 at 07:00:06PM +0100, Manuel Bouyer wrote:
 > > Thanks. How does this relates to the diff sent by Bill on this topic ?
 > > Is yours in addition to his diff, or does it remplace his diff ?
 > 
 > mine is separate from his.

 Ok

 > 
 > 
 > > Also is it easy to backport this to current ?
 > 
 > the diff is against today's current.  do you mean 3.x?

 Yes of course; netbsd-3

 > 
 > 
 > > BTW I've not had any problems since ftp.fr.netbsd.org runs with bill's patch.
 > 
 > yea, that's not surprising.  his patch dealt with the problems that would
 > be hit most often.  my patch is more thorough.

 Ok, I'll try yours when I have a chance, if I can get it in netbsd-3

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Chuck Silvers <chuq@chuq.com>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org,
	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/32535: processes stuck on vnlock
Date: Sun, 19 Nov 2006 10:14:57 -0800

 On Sun, Nov 19, 2006 at 07:00:06PM +0100, Manuel Bouyer wrote:
 > Thanks. How does this relates to the diff sent by Bill on this topic ?
 > Is yours in addition to his diff, or does it remplace his diff ?

 mine is separate from his.


 > Also is it easy to backport this to current ?

 the diff is against today's current.  do you mean 3.x?


 > BTW I've not had any problems since ftp.fr.netbsd.org runs with bill's patch.

 yea, that's not surprising.  his patch dealt with the problems that would
 be hit most often.  my patch is more thorough.

 -Chuck

From: Chuck Silvers <chuq@chuq.com>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org,
	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: kern/32535: processes stuck on vnlock
Date: Mon, 20 Nov 2006 09:57:46 -0800

 > Ok, I'll try yours when I have a chance, if I can get it in netbsd-3

 ok, I put a patch for 3.x in the same directory as the first.

 -Chuck

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org
Subject: Re: kern/32535: processes stuck on vnlock
Date: Wed, 29 Nov 2006 11:09:44 +0100

 On Mon, Nov 20, 2006 at 06:00:11PM +0000, Chuck Silvers wrote:
 > The following reply was made to PR kern/32535; it has been noted by GNATS.
 > 
 > From: Chuck Silvers <chuq@chuq.com>
 > To: Manuel Bouyer <bouyer@antioche.eu.org>
 > Cc: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org,
 > 	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
 > Subject: Re: kern/32535: processes stuck on vnlock
 > Date: Mon, 20 Nov 2006 09:57:46 -0800
 > 
 >  > Ok, I'll try yours when I have a chance, if I can get it in netbsd-3
 >  
 >  ok, I put a patch for 3.x in the same directory as the first.

 Hi,
 ftp.fr.netbsd.org is now running with your patch.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Chuck Silvers <chs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/32535 CVS commit: src
Date: Sat,  9 Dec 2006 16:11:53 +0000 (UTC)

 Module Name:	src
 Committed By:	chs
 Date:		Sat Dec  9 16:11:52 UTC 2006

 Modified Files:
 	src/share/man/man9: namei.9 vnodeops.9
 	src/sys/coda: coda_vfsops.c coda_vnops.c
 	src/sys/fs/adosfs: adlookup.c
 	src/sys/fs/cd9660: cd9660_lookup.c
 	src/sys/fs/filecorefs: filecore_lookup.c filecore_vfsops.c
 	src/sys/fs/msdosfs: msdosfs_lookup.c msdosfs_vnops.c
 	src/sys/fs/ntfs: ntfs.h ntfs_vnops.c
 	src/sys/fs/ptyfs: ptyfs_vfsops.c ptyfs_vnops.c
 	src/sys/fs/puffs: puffs_vfsops.c puffs_vnops.c
 	src/sys/fs/smbfs: smbfs_vfsops.c smbfs_vnops.c
 	src/sys/fs/sysvbfs: sysvbfs.c sysvbfs_vnops.c
 	src/sys/fs/tmpfs: tmpfs_vnops.c
 	src/sys/fs/udf: udf_vnops.c
 	src/sys/fs/union: union_subr.c union_vfsops.c union_vnops.c
 	src/sys/kern: vfs_cache.c vfs_getcwd.c vfs_lookup.c vfs_syscalls.c
 	src/sys/miscfs/deadfs: dead_vnops.c
 	src/sys/miscfs/fdesc: fdesc_vfsops.c fdesc_vnops.c
 	src/sys/miscfs/genfs: layer_subr.c layer_vnops.c
 	src/sys/miscfs/kernfs: kernfs_vfsops.c kernfs_vnops.c
 	src/sys/miscfs/portal: portal_vfsops.c portal_vnops.c
 	src/sys/miscfs/procfs: procfs_vfsops.c procfs_vnops.c
 	src/sys/miscfs/umapfs: umap_vnops.c
 	src/sys/nfs: nfs_export.c nfs_serv.c nfs_subs.c nfs_vnops.c
 	src/sys/sys: namei.h
 	src/sys/ufs/ext2fs: ext2fs_lookup.c ext2fs_vnops.c
 	src/sys/ufs/lfs: lfs_vnops.c
 	src/sys/ufs/ufs: ufs_extattr.c ufs_lookup.c ufs_vnops.c
 	src/sys/uvm: uvm_vnode.c

 Log Message:
 a smorgasbord of improvements to vnode locking and path lookup:
  - LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
    these now always return the parent vnode locked.  namei() works as before.
    lookup() and various other paths no longer acquire vnode locks in the
    wrong order via vrele().  fixes PR 32535.
    as a nice side effect, path lookup is also up to 25% faster.
  - the above allows us to get rid of PDIRUNLOCK.
  - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
  - remove an assumption in layer_node_find() that all file systems implement
    a recursive VOP_LOCK() (unionfs doesn't).
  - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
    fill in eopnotsupp() for file systems that don't support being exported
    and remove the checks for NULL.  (layerfs calls these without checking.)
  - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
    adjust which vnode is locked.  fixes PR 33374.
  - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().


 To generate a diff of this commit:
 cvs rdiff -r1.12 -r1.13 src/share/man/man9/namei.9
 cvs rdiff -r1.58 -r1.59 src/share/man/man9/vnodeops.9
 cvs rdiff -r1.52 -r1.53 src/sys/coda/coda_vfsops.c
 cvs rdiff -r1.50 -r1.51 src/sys/coda/coda_vnops.c
 cvs rdiff -r1.8 -r1.9 src/sys/fs/adosfs/adlookup.c
 cvs rdiff -r1.11 -r1.12 src/sys/fs/cd9660/cd9660_lookup.c
 cvs rdiff -r1.7 -r1.8 src/sys/fs/filecorefs/filecore_lookup.c
 cvs rdiff -r1.28 -r1.29 src/sys/fs/filecorefs/filecore_vfsops.c
 cvs rdiff -r1.10 -r1.11 src/sys/fs/msdosfs/msdosfs_lookup.c
 cvs rdiff -r1.34 -r1.35 src/sys/fs/msdosfs/msdosfs_vnops.c
 cvs rdiff -r1.14 -r1.15 src/sys/fs/ntfs/ntfs.h
 cvs rdiff -r1.30 -r1.31 src/sys/fs/ntfs/ntfs_vnops.c
 cvs rdiff -r1.21 -r1.22 src/sys/fs/ptyfs/ptyfs_vfsops.c
 cvs rdiff -r1.18 -r1.19 src/sys/fs/ptyfs/ptyfs_vnops.c
 cvs rdiff -r1.14 -r1.15 src/sys/fs/puffs/puffs_vfsops.c
 cvs rdiff -r1.21 -r1.22 src/sys/fs/puffs/puffs_vnops.c
 cvs rdiff -r1.60 -r1.61 src/sys/fs/smbfs/smbfs_vfsops.c
 cvs rdiff -r1.56 -r1.57 src/sys/fs/smbfs/smbfs_vnops.c
 cvs rdiff -r1.2 -r1.3 src/sys/fs/sysvbfs/sysvbfs.c
 cvs rdiff -r1.5 -r1.6 src/sys/fs/sysvbfs/sysvbfs_vnops.c
 cvs rdiff -r1.32 -r1.33 src/sys/fs/tmpfs/tmpfs_vnops.c
 cvs rdiff -r1.7 -r1.8 src/sys/fs/udf/udf_vnops.c
 cvs rdiff -r1.21 -r1.22 src/sys/fs/union/union_subr.c
 cvs rdiff -r1.40 -r1.41 src/sys/fs/union/union_vfsops.c
 cvs rdiff -r1.17 -r1.18 src/sys/fs/union/union_vnops.c
 cvs rdiff -r1.66 -r1.67 src/sys/kern/vfs_cache.c
 cvs rdiff -r1.33 -r1.34 src/sys/kern/vfs_getcwd.c
 cvs rdiff -r1.72 -r1.73 src/sys/kern/vfs_lookup.c
 cvs rdiff -r1.279 -r1.280 src/sys/kern/vfs_syscalls.c
 cvs rdiff -r1.41 -r1.42 src/sys/miscfs/deadfs/dead_vnops.c
 cvs rdiff -r1.62 -r1.63 src/sys/miscfs/fdesc/fdesc_vfsops.c
 cvs rdiff -r1.94 -r1.95 src/sys/miscfs/fdesc/fdesc_vnops.c
 cvs rdiff -r1.20 -r1.21 src/sys/miscfs/genfs/layer_subr.c
 cvs rdiff -r1.28 -r1.29 src/sys/miscfs/genfs/layer_vnops.c
 cvs rdiff -r1.74 -r1.75 src/sys/miscfs/kernfs/kernfs_vfsops.c
 cvs rdiff -r1.128 -r1.129 src/sys/miscfs/kernfs/kernfs_vnops.c
 cvs rdiff -r1.58 -r1.59 src/sys/miscfs/portal/portal_vfsops.c
 cvs rdiff -r1.68 -r1.69 src/sys/miscfs/portal/portal_vnops.c
 cvs rdiff -r1.67 -r1.68 src/sys/miscfs/procfs/procfs_vfsops.c
 cvs rdiff -r1.142 -r1.143 src/sys/miscfs/procfs/procfs_vnops.c
 cvs rdiff -r1.42 -r1.43 src/sys/miscfs/umapfs/umap_vnops.c
 cvs rdiff -r1.22 -r1.23 src/sys/nfs/nfs_export.c
 cvs rdiff -r1.119 -r1.120 src/sys/nfs/nfs_serv.c
 cvs rdiff -r1.177 -r1.178 src/sys/nfs/nfs_subs.c
 cvs rdiff -r1.245 -r1.246 src/sys/nfs/nfs_vnops.c
 cvs rdiff -r1.45 -r1.46 src/sys/sys/namei.h
 cvs rdiff -r1.46 -r1.47 src/sys/ufs/ext2fs/ext2fs_lookup.c
 cvs rdiff -r1.69 -r1.70 src/sys/ufs/ext2fs/ext2fs_vnops.c
 cvs rdiff -r1.193 -r1.194 src/sys/ufs/lfs/lfs_vnops.c
 cvs rdiff -r1.10 -r1.11 src/sys/ufs/ufs/ufs_extattr.c
 cvs rdiff -r1.80 -r1.81 src/sys/ufs/ufs/ufs_lookup.c
 cvs rdiff -r1.143 -r1.144 src/sys/ufs/ufs/ufs_vnops.c
 cvs rdiff -r1.77 -r1.78 src/sys/uvm/uvm_vnode.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: kern-bug-people->chs
Responsible-Changed-By: chs@netbsd.org
Responsible-Changed-When: Sat, 09 Dec 2006 16:41:19 +0000
Responsible-Changed-Why:
I've been working on it.


State-Changed-From-To: analyzed->feedback
State-Changed-By: chs@netbsd.org
State-Changed-When: Sun, 04 Feb 2007 15:29:38 +0000
State-Changed-Why:
all the changes I have for this are now in -current,
do you still see the problem there?


State-Changed-From-To: feedback->closed
State-Changed-By: ad@narn.netbsd.org
State-Changed-When: Thu, 31 Jan 2008 14:34:02 +0000
State-Changed-Why:
Remaining problem (vrele -> vn_lock) is fixed in -current.
Feedback timeout.
inode-level locking would prevent these types of problem occuring in the
future.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.