Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2008 20:04:31 +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: r186455 - head/sys/kern
Message-ID:  <200812232004.mBNK4VPP012218@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Dec 23 20:04:31 2008
New Revision: 186455
URL: http://svn.freebsd.org/changeset/base/186455

Log:
  Keep the hold on the vnode during VOP_VPTOCNP() call, allowing the vop
  implementation to drop vnode lock, if needed.
  
  Reported and tested by:	pho

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Tue Dec 23 19:59:21 2008	(r186454)
+++ head/sys/kern/vfs_cache.c	Tue Dec 23 20:04:31 2008	(r186455)
@@ -851,9 +851,9 @@ vn_vptocnp(struct vnode **vp, char **bp,
 	CACHE_UNLOCK();
 	vfslocked = VFS_LOCK_GIANT((*vp)->v_mount);
 	vn_lock(*vp, LK_SHARED | LK_RETRY);
-	vdrop(*vp);
 	error = VOP_VPTOCNP(*vp, &dvp, buf, buflen);
 	VOP_UNLOCK(*vp, 0);
+	vdrop(*vp);
 	VFS_UNLOCK_GIANT(vfslocked);
 	if (error) {
 		numfullpathfail2++;



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