From owner-freebsd-smp Thu Mar 14 10: 2:27 2002 Delivered-To: freebsd-smp@freebsd.org Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by hub.freebsd.org (Postfix) with ESMTP id 0FD0037B41B; Thu, 14 Mar 2002 10:02:13 -0800 (PST) Received: (from jake@localhost) by k6.locore.ca (8.11.6/8.11.6) id g2EI8hE57359; Thu, 14 Mar 2002 13:08:43 -0500 (EST) (envelope-from jake) Date: Thu, 14 Mar 2002 13:08:43 -0500 From: Jake Burkholder To: "Andrew R. Reiter" Cc: freebsd-smp@FreeBSD.ORG Subject: Re: Patch to lock down modules Message-ID: <20020314130843.B52298@locore.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from arr@FreeBSD.ORG on Thu, Mar 14, 2002 at 12:15:21PM -0500 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Apparently, On Thu, Mar 14, 2002 at 12:15:21PM -0500, Andrew R. Reiter said words to the effect of; > Hi all, > > I'd like to commit this patch soon, but I figure I should get > a feeling from this list as to whether or not this is should be > changed or if it's OK. The patch is located at: > > http://people.freebsd.org/~arr/modlock.diff > > Testing and review are encouraged. Couple problems: I think that you missed a MOD_SLOCK before the newmod = module_lookupbyname(data->name); in module_register. Also in that function the MOD_XLOCK isn't needed until just before the TAILQ_INSERT_TAIL. The increment of nextid needs something, I would probably move it to just before the TAILQ_INSERT, under the XLOCK. An atomic_add_and_return_old_value would be useful here. Also, I think that you should do another module_lookupbyname after acquiring the XLOCK and before the TAILQ_INSERT, because conceivably another module with the same name could show up when you release the SLOCK. Can you explain the wierd logic that was added to linker_file_unload? Thanks, Jake To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message