summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-04-10 10:22:44 +0000
committerkib <kib@FreeBSD.org>2009-04-10 10:22:44 +0000
commita5ecda6fd6358d3ff6a18998f98482335fb6c884 (patch)
tree1d4aba80f8d00165dcc019427b677a38db46a9e7 /sys/kern/vfs_cache.c
parent81638d98846e99a6bfcf7398057a650533aa1390 (diff)
downloadFreeBSD-src-a5ecda6fd6358d3ff6a18998f98482335fb6c884.zip
FreeBSD-src-a5ecda6fd6358d3ff6a18998f98482335fb6c884.tar.gz
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
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 49eccdd..6172f5b 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -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;
OpenPOWER on IntegriCloud