From owner-freebsd-stable@FreeBSD.ORG Wed Feb 11 22:13:35 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BF4F10656FD for ; Wed, 11 Feb 2009 22:13:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1909B8FC2E for ; Wed, 11 Feb 2009 22:13:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 8F22946B0C; Wed, 11 Feb 2009 17:13:34 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1BMDSMs028226; Wed, 11 Feb 2009 17:13:28 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-stable@freebsd.org Date: Wed, 11 Feb 2009 16:00:22 -0500 User-Agent: KMail/1.9.7 References: <47A0B642.9060000@icyb.net.ua> <200801311152.40064.jhb@freebsd.org> <47A20CCB.9020104@icyb.net.ua> In-Reply-To: <47A20CCB.9020104@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902111600.22611.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 11 Feb 2009 17:13:28 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8980/Wed Feb 11 11:40:45 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Andriy Gapon Subject: Re: kld regression X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:13:36 -0000 On Thursday 31 January 2008 1:00:43 pm Andriy Gapon wrote: > on 31/01/2008 18:52 John Baldwin said the following: > > On Thursday 31 January 2008 10:05:57 am Andriy Gapon wrote: > >> on 31/01/2008 14:39 Andriy Gapon said the following: > >>> on 31/01/2008 13:07 John Baldwin said the following: > >>>> On Wednesday 30 January 2008 12:39:14 pm Andriy Gapon wrote: > >>>>> The problem is as follows: > >>>>> 1. put udf_load="YES" in loader.conf > >>>>> 2. you can mount and unmount udf filesystems > >>>>> 3. you can kldunload udf if no udf filesystems are mounted > >>>>> 4. now mount udf fs while udf.ko is unloaded > >>>>> 5. udf is auto loaded and fs is mounted > >>>>> 6. unmount fs > >>>>> 7. try to kldunload udf > >>>>> kldunload: can't unload file: Device busy > >>>>> kernel message: kldunload: attempt to unload file that was loaded by the > >>>>> kernel > >>>>> > >>>>> Yeah, it was loaded by kernel indeed, but WTF - what is the difference > >>>>> from manual/loader.conf loading and why I can not manage my modules as I > >>>>> wish? > >>>> Hmm, the relevant code (vfs_init.c) hasn't changed in 6.x since 6.0. > > There > >>>> were some changes in 7.0, but this should work in both branches. What is > > the > >>>> previous release that this worked on? > >>>> > >>> Maybe I was wrong when I called this regression, but this was very > >>> surprising behavior for me. And in 5.X I did a lot of udf > >>> debugging/experimenting and never encountered such a problem. Maybe I > >>> always did kldload before mount, I can't tell now. > >>> Anyway, this seems like an annoyance at the very least, pinning a kernel > >>> module without any important reasons. > >>> > >> Hmm, I found one difference with previous setups: in step 1 I also have > >> udf_iconv_load="YES" and udf_iconv.ko module is what seems to prevent > >> udf.ko from unloading in step 7. I can actually unload udf_iconv and > >> then I am able again to unload udf. > >> > >> Still don't understand what is a big difference here. > >> > >> And if I had UDF_ICONV built into kernel then I wouldn't have this > >> work-around. > > > > Ah, I don't think we can safely unload modules loaded from the loader IIRC. > > > > John, > > maybe there is a small misunderstanding: > 1. udf.ko and udf_iconv.ko are both loaded by loader - I *can* unload udf.ko > 2. udf_iconv.ko is loaded by loader but udf.ko is auto-loaded (by > whatever) when I do mount_udf - I can not unload udf.ko unless I unload > udf_iconv.ko. > > This is inconsistent and there is no obvious reason for things being > this way. VFS_DECLARE_ICONV() in has always made foo_iconv.ko depend on foo.ko from the beginning of its existence. Thus, udf_iconv.ko has always depended on udf.ko. I think if you had UDF_ICONV in your kernel config without UDF it would fail to link. What I do find odd is that udf_iconv.ko worked at all, perhaps the linker resolved it and linked it in when udf.ko was loaded, as prior to udf.ko being loaded it was missing a symbol in udf.ko it has a reference to. Either that or the loader was loading udf.ko as a dependency and you didn't realize it. -- John Baldwin