git: 46cc15529fbf - stable/13 - vfs cache: garbage collect the fullpathfail2 counter

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Wed, 04 Oct 2023 12:09:01 UTC
The branch stable/13 has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=46cc15529fbfee0df5a124a3221c4446f0902fe3

commit 46cc15529fbfee0df5a124a3221c4446f0902fe3
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2023-09-14 20:25:54 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2023-10-04 12:05:59 +0000

    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.
    
    (cherry picked from commit 07f52c4b5a4f7a658bf7ed29eadd5c4d52a4f3b2)
---
 sys/kern/vfs_cache.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 151d0d2ac8a1..a50e8010fb88 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -546,7 +546,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)");
@@ -3384,14 +3383,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;