Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756721AbXKFVul (ORCPT ); Tue, 6 Nov 2007 16:50:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754203AbXKFVue (ORCPT ); Tue, 6 Nov 2007 16:50:34 -0500 Received: from pne-smtpout2-sn1.fre.skanova.net ([81.228.11.159]:60673 "EHLO pne-smtpout2-sn1.fre.skanova.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752041AbXKFVud (ORCPT ); Tue, 6 Nov 2007 16:50:33 -0500 X-Greylist: delayed 487 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Nov 2007 16:50:33 EST Date: Tue, 6 Nov 2007 22:42:24 +0100 (CET) From: Peter Osterlund X-X-Sender: petero@quad.localdomain To: Thomas Maier cc: Tejun Heo , Jens Axboe , linux-kernel , gregkh@suse.de Subject: Re: pktcdvd oops In-Reply-To: Message-ID: References: <20071105092018.GD5359@kernel.dk> <47302E9F.6020708@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1482 Lines: 42 On Tue, 6 Nov 2007, Thomas Maier wrote: > Hello, > > have not tested it yet, but i quess, the code mentioned by Peter > is in pkt_new_dev() that is called by pkt_setup_dev(): > > /* This is safe, since we have a reference from open(). */ > __module_get(THIS_MODULE); > > > So, now, there must be checks in every sysfs operation in the module code, > to ensure that the module is still loaded? I haven't tested it either yet. What I don't understand is this: If the __module_get() is not safe because the module code could have already been unloaded, how can it possibly be made safe by adding more code to the pktcdvd module? If the module is unloaded, trying to execute its code can't be a good thing no matter what the code does. > BTW: the bug report says: > > Steps to reproduce: > > modprobe pktcdvd > echo 22:0 >/sys/class/pktcdvd/add > > Is there any module unload??? Why is the module not available after the > modprobe, but the sysfs entries, generated by the module? Confused ;) I think the purpose of the BUG_ON in __module_get() is to catch cases that are unsafe, even if the call would have happened to work in this particular case. -- Peter Osterlund - petero2@telia.com http://web.telia.com/~u89404340 - 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/