svn commit: r364371 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Wed Aug 19 02:50:10 UTC 2020


Author: mjg
Date: Wed Aug 19 02:50:09 2020
New Revision: 364371
URL: https://svnweb.freebsd.org/changeset/base/364371

Log:
  vfs: sanity check mount counters in vfs_op_enter

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c	Wed Aug 19 02:18:11 2020	(r364370)
+++ head/sys/kern/vfs_mount.c	Wed Aug 19 02:50:09 2020	(r364371)
@@ -1518,6 +1518,9 @@ vfs_op_enter(struct mount *mp)
 		mp->mnt_writeopcount +=
 		    zpcpu_replace_cpu(mp->mnt_writeopcount_pcpu, 0, cpu);
 	}
+	if (mp->mnt_ref <= 0 || mp->mnt_lockref < 0 || mp->mnt_writeopcount < 0)
+		panic("%s: invalid count(s) on mp %p: ref %d lockref %d writeopcount %d\n",
+		    __func__, mp, mp->mnt_ref, mp->mnt_lockref, mp->mnt_writeopcount);
 	MNT_IUNLOCK(mp);
 	vfs_assert_mount_counters(mp);
 }


More information about the svn-src-head mailing list