From owner-p4-projects Sat Jul 6 9:33:22 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AD2D937B401; Sat, 6 Jul 2002 09:33:17 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C44737B400 for ; Sat, 6 Jul 2002 09:33:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 085EC43E3B for ; Sat, 6 Jul 2002 09:33:17 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g66GXGJU009960 for ; Sat, 6 Jul 2002 09:33:16 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g66GXGt1009957 for perforce@freebsd.org; Sat, 6 Jul 2002 09:33:16 -0700 (PDT) Date: Sat, 6 Jul 2002 09:33:16 -0700 (PDT) Message-Id: <200207061633.g66GXGt1009957@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 13835 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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