From owner-freebsd-fs@FreeBSD.ORG Thu Mar 29 07:32:06 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1DF1216A405 for ; Thu, 29 Mar 2007 07:32:06 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id D565D13C43E for ; Thu, 29 Mar 2007 07:32:05 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 70DA32100; Thu, 29 Mar 2007 09:32:00 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on tim.des.no Received: from dwp.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 98F93207E; Thu, 29 Mar 2007 09:31:59 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 1001) id 7DB6AA1073; Thu, 29 Mar 2007 09:31:59 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: Aniruddha Bohra References: <460AA411.3010904@cs.rutgers.edu> Date: Thu, 29 Mar 2007 09:31:59 +0200 In-Reply-To: <460AA411.3010904@cs.rutgers.edu> (Aniruddha Bohra's message of "Wed, 28 Mar 2007 13:21:21 -0400") Message-ID: <861wj8sdxs.fsf@dwp.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@freebsd.org Subject: Re: Pseudofs question X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2007 07:32:06 -0000 Aniruddha Bohra writes: > Pseudofs handles the fileno allocation and deallocation using > alloc_unr() and free_unr(). > > The fileno is allocated on demand when vn_readdir is called > (pseudofs_vnops.c). However, > I could not find the deallocation in pseudofs. > > So, when I unload my fs module, I get a crash with the unit busy: > kern/subr_unit.c:321 KASSERT(uh->busy =3D=3D 0, ("unrhdr has %u > allocations", uh->busy)); > > This is a good kassert as the pfs_fileno_free is never called. Damn. Pseudofs used to have its own fileno allocator, which contained the following comment: #if 0 /* we currently don't reclaim filenos */ if (used > 2) printf("WARNING: %d file numbers still in use\n", used); #endif I obviously didn't pay close enough attention when I reviewed the switch to *_unr(). > Actually, the module unload function calls _fsname_uninit() which > calls pfs_uninit() which calls pfs_fileno_uninit(pi) without first > destroying the file system or deallocating any allocated unit > numbers. Again, this was fine when we had our own allocator. It obviously isn't fine now. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no