Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Mar 2007 09:31:59 +0200
From:      des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=)
To:        Aniruddha Bohra <bohra@cs.rutgers.edu>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Pseudofs question
Message-ID:  <861wj8sdxs.fsf@dwp.des.no>
In-Reply-To: <460AA411.3010904@cs.rutgers.edu> (Aniruddha Bohra's message of "Wed, 28 Mar 2007 13:21:21 -0400")
References:  <460AA411.3010904@cs.rutgers.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Aniruddha Bohra <bohra@cs.rutgers.edu> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?861wj8sdxs.fsf>