Author: kan
Date: Fri Apr 17 21:10:53 2009
New Revision: 191223
URL: http://svn.freebsd.org/changeset/base/191223

Log:
  MFC r191218 and related backout r191220.
  
  More fallout from negative dotdot caching. Negative entries should
  be removed from and reinserted to proper ncneg list.
  
  Reported by:  pho
  Submitted by: kib
  Approved by:  re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/vfs_cache.c

Modified: stable/7/sys/kern/vfs_cache.c
==============================================================================
--- stable/7/sys/kern/vfs_cache.c       Fri Apr 17 19:07:44 2009        
(r191222)
+++ stable/7/sys/kern/vfs_cache.c       Fri Apr 17 21:10:53 2009        
(r191223)
@@ -535,18 +535,23 @@ cache_enter(dvp, vp, cnp)
                         * to new parent vnode, otherwise continue with new
                         * namecache entry allocation.
                         */
-                       if ((ncp = dvp->v_cache_dd) != NULL) {
-                               if (ncp->nc_flag & NCF_ISDOTDOT) {
-                                       KASSERT(ncp->nc_dvp == dvp,
-                                           ("wrong isdotdot parent"));
+                       if ((ncp = dvp->v_cache_dd) != NULL &&
+                           ncp->nc_flag & NCF_ISDOTDOT) {
+                               KASSERT(ncp->nc_dvp == dvp,
+                                   ("wrong isdotdot parent"));
+                               if (ncp->nc_vp != NULL)
                                        TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst,
                                            ncp, nc_dst);
+                               else
+                                       TAILQ_REMOVE(&ncneg, ncp, nc_dst);
+                               if (vp != NULL)
                                        TAILQ_INSERT_HEAD(&vp->v_cache_dst,
                                            ncp, nc_dst);
-                                       ncp->nc_vp = vp;
-                                       CACHE_UNLOCK();
-                                       return;
-                               }
+                               else
+                                       TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst);
+                               ncp->nc_vp = vp;
+                               CACHE_UNLOCK();
+                               return;
                        }
                        dvp->v_cache_dd = NULL;
                        CACHE_UNLOCK();
_______________________________________________
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