Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jul 2002 09:33:16 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 13835 for review
Message-ID:  <200207061633.g66GXGt1009957@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=13835

Change 13835 by rwatson@rwatson_paprika on 2002/07/06 09:32:52

	Fail a little more gracefully if v_mount is NULL, and generate
	some debugging output when it happens.  On some of my boxes,
	I occasionally find this code dereferencing a null v_mount
	despite the vnode locks, which suggests either a race or a
	possible nit involving specfs/deadfs.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#158 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#158 (text+ko) ====

@@ -956,6 +956,22 @@
 
 	ASSERT_VOP_LOCKED(vp, "vn_refreshlabel");
 
+	if (vp->v_mount == NULL) {
+/*
+		Eventually, we probably want to special-case refreshing
+		of deadfs vnodes, and if there's a lock-free race somewhere,
+		that case might be handled here.
+
+		mac_update_vnode_deadfs(vp);
+		return (0);
+ */
+		printf("vn_refreshlabel: null v_mount\n");
+		if (vp->v_type != VT_NON)
+			printf(
+			    "vn_refreshlabel: null v_mount with non-VT_NON\n");
+		return (EBADF);
+	}
+
 	if ((vp->v_mount->mnt_flag & MNT_MULTILABEL) == 0) {
 		mac_update_vnode_from_mount(vp, vp->v_mount);
 		return (0);
@@ -2297,6 +2313,12 @@
 {
 	int error;
 
+	if (vp->v_mount == NULL) {
+		printf("vn_setlabel: null v_mount\n");
+		if (vp->v_type != VT_NON)
+			printf("vn_setlabel: null v_mount with non-VT_NON\n");
+		return (EBADF);
+	}
 	/*
 	 * Multi-phase commit.  First check the policies to confirm the
 	 * change is OK.  Then commit via the filesystem.  Finally,

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207061633.g66GXGt1009957>