- Clear v_dd in cache_zap() instead of cache_purge() as cache_purge() may
not be called in all cases where we free the cnp. Sponsored by: Isilon Systems, Inc.
This commit is contained in:
parent
8145dc3160
commit
6bd8103d33
@ -281,6 +281,7 @@ cache_zap(ncp)
|
|||||||
}
|
}
|
||||||
if (ncp->nc_vp) {
|
if (ncp->nc_vp) {
|
||||||
TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst);
|
TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst);
|
||||||
|
ncp->nc_vp->v_dd = NULL;
|
||||||
} else {
|
} else {
|
||||||
TAILQ_REMOVE(&ncneg, ncp, nc_dst);
|
TAILQ_REMOVE(&ncneg, ncp, nc_dst);
|
||||||
numneg--;
|
numneg--;
|
||||||
@ -577,22 +578,11 @@ void
|
|||||||
cache_purge(vp)
|
cache_purge(vp)
|
||||||
struct vnode *vp;
|
struct vnode *vp;
|
||||||
{
|
{
|
||||||
struct namecache *ncp;
|
|
||||||
|
|
||||||
CTR1(KTR_VFS, "cache_purge(%p)", vp);
|
CTR1(KTR_VFS, "cache_purge(%p)", vp);
|
||||||
CACHE_LOCK();
|
CACHE_LOCK();
|
||||||
while (!LIST_EMPTY(&vp->v_cache_src)) {
|
while (!LIST_EMPTY(&vp->v_cache_src))
|
||||||
struct vnode *cvp;
|
cache_zap(LIST_FIRST(&vp->v_cache_src));
|
||||||
|
|
||||||
ncp = LIST_FIRST(&vp->v_cache_src);
|
|
||||||
/*
|
|
||||||
* We must reset v_dd of any children so they don't
|
|
||||||
* continue to point to us.
|
|
||||||
*/
|
|
||||||
if ((cvp = ncp->nc_vp) && cvp->v_dd == vp)
|
|
||||||
cvp->v_dd = NULL;
|
|
||||||
cache_zap(ncp);
|
|
||||||
}
|
|
||||||
while (!TAILQ_EMPTY(&vp->v_cache_dst))
|
while (!TAILQ_EMPTY(&vp->v_cache_dst))
|
||||||
cache_zap(TAILQ_FIRST(&vp->v_cache_dst));
|
cache_zap(TAILQ_FIRST(&vp->v_cache_dst));
|
||||||
vp->v_dd = NULL;
|
vp->v_dd = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user