From 987d08edb70b8a2b7ece4a4f9c6733d7ebc10253 Mon Sep 17 00:00:00 2001 From: kan Date: Wed, 15 Apr 2009 16:36:13 +0000 Subject: [PATCH] MFC r191081-191082: Properly handle negative cache enries found through dotdot lookups. Submitted by: tegge Approved by: re(kib) _M sys M sys/kern/vfs_cache.c _M sys/dev/cxgb _M sys/dev/ath/ath_hal _M sys/contrib/pf git-svn-id: svn://svn.freebsd.org/base/releng/7.2@191107 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/kern/vfs_cache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 6805f766..e7b69f05 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -370,6 +370,11 @@ retry: *vpp = dvp->v_cache_dd->nc_vp; else *vpp = dvp->v_cache_dd->nc_dvp; + /* Return failure if negative entry was found. */ + if (*vpp == NULL) { + ncp = dvp->v_cache_dd; + goto negative_success; + } CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", dvp, cnp->cn_nameptr, *vpp); goto success; @@ -416,6 +421,7 @@ retry: goto success; } +negative_success: /* We found a negative match, and want to create it, so purge */ if (cnp->cn_nameiop == CREATE) { numnegzaps++; -- 2.45.0