Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jun 2010 10:20:09 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208773 - head/sys/kern
Message-ID:  <201006031020.o53AK9uM043309@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jun  3 10:20:08 2010
New Revision: 208773
URL: http://svn.freebsd.org/changeset/base/208773

Log:
  Sometimes vnodes share the lock despite being different vnodes on
  different mount points, e.g. the nullfs vnode and the covered vnode
  from the lower filesystem. In this case, existing assertion in
  vop_rename_pre() may be triggered.
  
  Check for vnode locks equiality instead of the vnodes itself to
  not trip over the situation.
  
  Submitted by:	Mikolaj Golub <to.my.trociny@gmail.com>
  Tested by:	pho
  MFC after:	2 weeks

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Thu Jun  3 10:11:45 2010	(r208772)
+++ head/sys/kern/vfs_subr.c	Thu Jun  3 10:20:08 2010	(r208773)
@@ -3793,9 +3793,10 @@ vop_rename_pre(void *ap)
 	ASSERT_VI_UNLOCKED(a->a_fdvp, "VOP_RENAME");
 
 	/* Check the source (from). */
-	if (a->a_tdvp != a->a_fdvp && a->a_tvp != a->a_fdvp)
+	if (a->a_tdvp->v_vnlock != a->a_fdvp->v_vnlock &&
+	    (a->a_tvp == NULL || a->a_tvp->v_vnlock != a->a_fdvp->v_vnlock))
 		ASSERT_VOP_UNLOCKED(a->a_fdvp, "vop_rename: fdvp locked");
-	if (a->a_tvp != a->a_fvp)
+	if (a->a_tvp == NULL || a->a_tvp->v_vnlock != a->a_fvp->v_vnlock)
 		ASSERT_VOP_UNLOCKED(a->a_fvp, "vop_rename: fvp locked");
 
 	/* Check the target. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006031020.o53AK9uM043309>