aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2023-09-14 20:25:54 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2023-09-24 21:45:51 +0000
commitdc804471fa88a60d8112d7beea59c39cf2c1d123 (patch)
treee008da00e9edd2e6b3ecad603489207930960395
parent6d5db9c5239b3ed27fec9d52420443ab800353ea (diff)
downloadsrc-dc804471fa88a60d8112d7beea59c39cf2c1d123.tar.gz
src-dc804471fa88a60d8112d7beea59c39cf2c1d123.zip
vfs cache: garbage collect the fullpathfail2 counter
The conditions it checks cannot legally be true (modulo races against forced unmount), so assert on it instead. Approved by: re (gjb) (cherry picked from commit 07f52c4b5a4f7a658bf7ed29eadd5c4d52a4f3b2) (cherry picked from commit 8e4a043bad750d85e0028ae6ceb9c9e37842bf4a)
-rw-r--r--sys/kern/vfs_cache.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 5b0cd64146ad..0f4d7526ebb5 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -542,7 +542,6 @@ STATNODE_COUNTER(negzaps, numnegzaps,
STATNODE_COUNTER(neghits, numneghits, "Number of cache hits (negative)");
/* These count for vn_getcwd(), too. */
STATNODE_COUNTER(fullpathcalls, numfullpathcalls, "Number of fullpath search calls");
-STATNODE_COUNTER(fullpathfail1, numfullpathfail1, "Number of fullpath search errors (ENOTDIR)");
STATNODE_COUNTER(fullpathfail2, numfullpathfail2,
"Number of fullpath search errors (VOP_VPTOCNP failures)");
STATNODE_COUNTER(fullpathfail4, numfullpathfail4, "Number of fullpath search errors (ENOMEM)");
@@ -3400,14 +3399,7 @@ vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, char *buf, char **retbuf,
vp = vp1;
continue;
}
- if (vp->v_type != VDIR) {
- vrele(vp);
- counter_u64_add(numfullpathfail1, 1);
- error = ENOTDIR;
- SDT_PROBE3(vfs, namecache, fullpath, return,
- error, vp, NULL);
- break;
- }
+ VNPASS(vp->v_type == VDIR || VN_IS_DOOMED(vp), vp);
error = vn_vptocnp(&vp, buf, &buflen);
if (error)
break;