in cache_lookup(), if we get a cache hit but then fail to vget() the found
vnode, we should not attempt to remove the namecache entry. this is because vget() can sleep (eg. if VXLOCK is set because the vnode is being reclaimed), and so multiple threads can end up in this context at the same time. if this happens, each thread ends up removing the cache entry, but the code to remove the entry assumes that the entry is still valid. so we should just leave the (now stale) entry in the cache. if another thread finds the entry again before it is reused, that thread will notice that the entry is stale and remove it safely. fixes PR 14042.
This commit is contained in:
parent
32b3143333
commit
a54f8441f8
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vfs_cache.c,v 1.30 2001/09/24 06:01:13 chs Exp $ */
|
||||
/* $NetBSD: vfs_cache.c,v 1.31 2001/10/27 04:53:38 chs Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -217,7 +217,8 @@ cache_lookup(dvp, vpp, cnp)
|
|||
return (error);
|
||||
cnp->cn_flags &= ~PDIRUNLOCK;
|
||||
}
|
||||
goto remove;
|
||||
*vpp = NULL;
|
||||
return (-1);
|
||||
}
|
||||
|
||||
nchstats.ncs_goodhits++;
|
||||
|
|
Loading…
Reference in New Issue