From 3f54086eba4a1df9981cee3e8f94a3b2b652c205 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 10 Apr 2009 10:22:44 +0000 Subject: 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 --- sys/kern/vfs_cache.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sys/kern/vfs_cache.c') diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 49eccdd0e2f7..6172f5b92a48 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; -- cgit v1.2.3