⬢ DragonFlyBSD Kernel Audit
DF-3253 / stats_applied.diff
← back to finding ↓ download raw
--- a/sys/vfs/hpfs/hpfs_hash.c	2026-06-29 12:51:19.000000000 +0000
+++ b/sys/vfs/hpfs/hpfs_hash.c	2026-09-09 14:47:32.200502750 +0000
@@ -54,6 +54,10 @@
 #endif
 struct lock hpfs_hphash_lock;
 
+/* DF3253 instrumentation */
+unsigned int df3253_pub, df3253_hits, df3253_vfail, df3253_idfail, df3253_inval;
+
+
 /*
  * Initialize inode hash table.
  */
@@ -112,9 +116,14 @@
 		if (ino != hp->h_no || dev != hp->h_dev)
 			continue;
 		vp = HPTOV(hp);
+		if (++df3253_hits % 512 == 0)
+			kprintf("DF3253S: hits=%u vfail=%u idfail=%u inval=%u\n",
+			    df3253_hits, df3253_vfail, df3253_idfail, df3253_inval);
 
-		if (vget(vp, LK_EXCLUSIVE))
+		if (vget(vp, LK_EXCLUSIVE)) {
+			++df3253_vfail;
 			goto loop;
+		}
 		/*
 		 * We must check to see if the inode has been ripped
 		 * out from under us after blocking.
@@ -124,9 +133,15 @@
 				break;
 		}
 		if (hp == NULL || vp != HPTOV(hp)) {
+			++df3253_idfail;
 			vput(vp);
 			goto loop;
 		}
+		if (hp->h_flag & H_INVAL) {
+			++df3253_inval;
+			kprintf("DF3253S: INVAL HANDOFF #%u (pub=%u hits=%u vfail=%u idfail=%u)\n",
+			    df3253_inval, df3253_pub, df3253_hits, df3253_vfail, df3253_idfail);
+		}
 
 		/*
 		 * Or if the vget fails (due to a race)