From owner-cvs-src@FreeBSD.ORG Sat Jul 15 12:03:09 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 96C1816A4E0; Sat, 15 Jul 2006 12:03:09 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from www.ebusiness-leidinger.de (jojo.ms-net.de [84.16.236.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74D4F43D92; Sat, 15 Jul 2006 12:02:32 +0000 (GMT) (envelope-from netchild@FreeBSD.org) Received: from Andro-Beta.Leidinger.net (p54A5CD99.dip.t-dialin.net [84.165.205.153]) (authenticated bits=0) by www.ebusiness-leidinger.de (8.13.6/8.13.6) with ESMTP id k6FBqWUs029332; Sat, 15 Jul 2006 13:52:32 +0200 (CEST) (envelope-from netchild@FreeBSD.org) Received: from Magellan.Leidinger.net (Magellan.Leidinger.net [192.168.1.1]) by Andro-Beta.Leidinger.net (8.13.4/8.13.3) with ESMTP id k6FC2Wck047760; Sat, 15 Jul 2006 14:02:33 +0200 (CEST) (envelope-from netchild@FreeBSD.org) Date: Sat, 15 Jul 2006 14:03:47 +0200 From: Alexander Leidinger To: Robert Watson Message-ID: <20060715140347.4333991f@Magellan.Leidinger.net> In-Reply-To: <20060715102243.X61840@fledge.watson.org> References: <200607081406.k68E6u3w049339@repoman.freebsd.org> <20060714193538.GN25976@elvis.mu.org> <20060715102243.X61840@fledge.watson.org> Organization: FreeBSD X-Mailer: Sylpheed-Claws 2.3.1 (GTK+ 2.8.20; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new Cc: cvs-src@FreeBSD.org, Alfred Perlstein , cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/pseudofs pseudofs_vnops.c src/sys/compat/linux linux_misc.c src/sys/compat/linprocfs linprocfs.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2006 12:03:09 -0000 Quoting Robert Watson (Sat, 15 Jul 2006 10:23:28 +0100 (BST)): > > On Fri, 14 Jul 2006, Alfred Perlstein wrote: > > > Could the KASSERT here be changed to a warning log message instead? > > > > I don't like the idea of kernel modules failing catastrophically > > when they could fail gracefully by just emitting an error. > > > > Is that OK? > > > > + KASSERT(kp.ki_stat <= sizeof(linux_state), > > + ("linprocfs: don't know how to handle unknown FreeBSD state")); > > Or, if this is really just a structure size thing, we should pick it up at > compile-time with CTASSERT? ki_stat contains a value which corresponds to the states like idle, diskwait, ... And linux_state is a static array (ki_stat is an index into it). We don't have a "this value is an upper bound to the possible state values"-value, so I can't use an CTASSERT. This will only panic when someone adds another state to the existing ones but doesn't extend the array. Suggestions how to handle this in a way which satisfies everyone is welcome (is a warning enough?). Bye, Alexander. -- ...and that is how we know the Earth to be banana-shaped. http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137