Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Apr 2009 10:22:44 +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: r190887 - in head/sys: kern nfsclient
Message-ID:  <200904101022.n3AAMipM045752@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Apr 10 10:22:44 2009
New Revision: 190887
URL: http://svn.freebsd.org/changeset/base/190887

Log:
  Cache_lookup() for DOTDOT drops dvp vnode lock, allowing dvp to be reclaimed.
  Check the condition and return ENOENT then.
  
  In nfs_lookup(), respect ENOENT return from cache_lookup() when it is caused
  by dvp reclaim.
  
  Reported and tested by:	pho

Modified:
  head/sys/kern/vfs_cache.c
  head/sys/nfsclient/nfs_vnops.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Fri Apr 10 10:16:03 2009	(r190886)
+++ head/sys/kern/vfs_cache.c	Fri Apr 10 10:22:44 2009	(r190887)
@@ -554,8 +554,15 @@ success:
 	else
 		CACHE_RUNLOCK();
 	error = vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, cnp->cn_thread);
-	if (cnp->cn_flags & ISDOTDOT)
+	if (cnp->cn_flags & ISDOTDOT) {
 		vn_lock(dvp, ltype | LK_RETRY);
+		if (dvp->v_iflag & VI_DOOMED) {
+			if (error == 0)
+				vput(*vpp);
+			*vpp = NULL;
+			return (ENOENT);
+		}
+	}
 	if (error) {
 		*vpp = NULL;
 		goto retry;

Modified: head/sys/nfsclient/nfs_vnops.c
==============================================================================
--- head/sys/nfsclient/nfs_vnops.c	Fri Apr 10 10:16:03 2009	(r190886)
+++ head/sys/nfsclient/nfs_vnops.c	Fri Apr 10 10:22:44 2009	(r190887)
@@ -978,6 +978,8 @@ nfs_lookup(struct vop_lookup_args *ap)
 			vrele(newvp);
 		*vpp = NULLVP;
 	} else if (error == ENOENT) {
+		if (dvp->v_iflag & VI_DOOMED)
+			return (ENOENT);
 		/*
 		 * We only accept a negative hit in the cache if the
 		 * modification time of the parent directory matches



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