Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264220AbTIIQjG (ORCPT ); Tue, 9 Sep 2003 12:39:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264222AbTIIQjF (ORCPT ); Tue, 9 Sep 2003 12:39:05 -0400 Received: from modemcable137.219-201-24.mtl.mc.videotron.ca ([24.201.219.137]:64897 "EHLO montezuma.fsmlabs.com") by vger.kernel.org with ESMTP id S264220AbTIIQjD (ORCPT ); Tue, 9 Sep 2003 12:39:03 -0400 Date: Tue, 9 Sep 2003 12:38:51 -0400 (EDT) From: Zwane Mwaikambo To: Greg KH cc: Linux Kernel , John Levon Subject: Re: [PATCH][2.6][CFT] rmmod floppy kills box fixes + default_device_remove In-Reply-To: Message-ID: References: <20030908155048.GA10879@kroah.com> <20030908230852.GA3320@kroah.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1087 Lines: 34 On Tue, 9 Sep 2003, Zwane Mwaikambo wrote: > > So an empty release() function is the wrong thing to do in 99.99% of the > > situations in the kernel (the one exception seems to be the mca release > > function that recently got added for use when the bus is doing probing > > logic.) > > > > Does this help out? > > Yes thanks, i was confused over which memory references had to be > maintained. Ok i had another look and i can see why you need a seperate release function, as we don't always do the kobject_cleanup immediately. John and myself had a look and now we have the following race on ->release() function exit. my_release_fn() { complete(&my_completion); <== [1] stall anywhere here, e.g. preempt/schedule } cleanup_module() { wait_for_completion(&my_completion); <== [1] this task gets scheduled, free()s module text } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/