From owner-cvs-all@FreeBSD.ORG Mon Aug 18 17:54:46 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DCD137B404; Mon, 18 Aug 2003 17:54:46 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id A483443FB1; Mon, 18 Aug 2003 17:54:44 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h7J0sgrO005203; Mon, 18 Aug 2003 20:54:43 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h7J0sgSm005200; Mon, 18 Aug 2003 20:54:42 -0400 (EDT) Date: Mon, 18 Aug 2003 20:54:42 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE cc: des@des.no cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: cvs-src@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/pseudofs pseudofs_vnops.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2003 00:54:46 -0000 On Mon, 18 Aug 2003, John Baldwin wrote: > On 18-Aug-2003 Dag-Erling Sm=F8rgrav wrote: > > John Baldwin writes: > >> Log: > >> The allproc lock is a sx lock, not a mutex, so fix the assertion. T= his > >> asserts that the sx lock is held, but does not specify if the lock i= s held > >> shared or exclusive, thus either type of lock satisfies the assertio= n. > >=20 > > My bad - but why didn't I get a warning about the incorrect pointer > > type? And why did the code run fine with INVARIANT_SUPPORT and > > INVARIANTS defined? Just lucky? >=20 > It shouldn't have compiled in a static kernel, and the module should > have failed to load. You did get a warning actually, that is how I > noticed this. module builds don't error out on warnings though, only > kernel builds do. Ah 'allproc' is the name of the actual linked list > head, so the module did load and link ok, it just examined the head of > the allproc list and treated that as a mutex. I've no idea why it > worked. Perhaps your kernel did not have INVARIANT_SUPPORT defined in > its config?=20 Modules are built without the kernel configuration context, so modules are never built with conditionally compiled INVARIANTS pieces. In order for any assertions in a module to get compiled in, you have to add INVARIANTS to the module Makefile. We have to link mac_test into the kernel itself rather than use a module if we want any of its assertions to trigger. As a result of all this, if any of the conditionally compiled code would generate a compiler error or a warning, you don't hit it with a module build either... Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories