Date: Fri, 3 Jan 2014 20:02:59 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r260241 - stable/9/sys/kern Message-ID: <201401032002.s03K2xwo021383@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Jan 3 20:02:59 2014 New Revision: 260241 URL: http://svnweb.freebsd.org/changeset/base/260241 Log: MFC r259953: Fix accounting for the negative cache entries when reusing v_cache_dd. Modified: stable/9/sys/kern/vfs_cache.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_cache.c ============================================================================== --- stable/9/sys/kern/vfs_cache.c Fri Jan 3 20:02:30 2014 (r260240) +++ stable/9/sys/kern/vfs_cache.c Fri Jan 3 20:02:59 2014 (r260241) @@ -749,16 +749,20 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp ncp->nc_flag & NCF_ISDOTDOT) { KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); - if (ncp->nc_vp != NULL) + if (ncp->nc_vp != NULL) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - else + } else { TAILQ_REMOVE(&ncneg, ncp, nc_dst); - if (vp != NULL) + numneg--; + } + if (vp != NULL) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); - else + } else { TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); + numneg++; + } ncp->nc_vp = vp; CACHE_WUNLOCK(); return; @@ -894,6 +898,8 @@ cache_enter_time(dvp, vp, cnp, tsp, dtsp } if (numneg * ncnegfactor > numcache) { ncp = TAILQ_FIRST(&ncneg); + KASSERT(ncp->nc_vp == NULL, ("ncp %p vp %p on ncneg", + ncp, ncp->nc_vp)); zap = 1; } if (hold)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401032002.s03K2xwo021383>