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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to