From owner-freebsd-fs@FreeBSD.ORG Wed Mar 28 17:46:20 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 BF57916A402 for ; Wed, 28 Mar 2007 17:46:20 +0000 (UTC) (envelope-from bohra@cs.rutgers.edu) Received: from mail.nec-labs.com (mail.nec-labs.com [138.15.200.209]) by mx1.freebsd.org (Postfix) with ESMTP id 85CBA13C48C for ; Wed, 28 Mar 2007 17:46:20 +0000 (UTC) (envelope-from bohra@cs.rutgers.edu) Received: from mail.nec-labs.com (localhost.localdomain [127.0.0.1]) by mail.nec-labs.com (8.13.6/8.13.6) with ESMTP id l2SHMsos012278 for ; Wed, 28 Mar 2007 13:22:54 -0400 Received: from mailer.nec-labs.com (mailer.nec-labs.com [138.15.108.3]) by mail.nec-labs.com (8.13.6/8.13.6) with ESMTP id l2SHMrmq012272; Wed, 28 Mar 2007 13:22:54 -0400 Received: from [138.15.109.80] ([138.15.109.80] unverified) by mailer.nec-labs.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 28 Mar 2007 13:22:54 -0400 Message-ID: <460AA411.3010904@cs.rutgers.edu> Date: Wed, 28 Mar 2007 13:21:21 -0400 From: Aniruddha Bohra User-Agent: Thunderbird 1.5.0.9 (X11/20070217) MIME-Version: 1.0 To: freebsd-fs@freebsd.org, =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Mar 2007 17:22:54.0046 (UTC) FILETIME=[B8402FE0:01C7715D] Cc: Subject: 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: Wed, 28 Mar 2007 17:46:20 -0000 Hi, 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 == 0, ("unrhdr has %u allocations", uh->busy)); This is a good kassert as the pfs_fileno_free is never called. 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. Am I missing something obvious in my implementation since I do not see a similar crash with procfs :( Thanks Aniruddha