All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Greg KH <gregkh@suse.de>
Cc: "Denis V. Lunev" <den@openvz.org>,
	akpm@linux-foundation.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: [PATCH 3/4] modules: proper cleanup of kobject without CONFIG_SYSFS
Date: Fri, 23 May 2008 11:34:35 +1000	[thread overview]
Message-ID: <200805231134.35462.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20080522175415.GD8859@suse.de>

On Friday 23 May 2008 03:54:15 Greg KH wrote:
> On Thu, May 22, 2008 at 07:20:22PM +1000, Rusty Russell wrote:
> > On Tuesday 20 May 2008 19:59:48 Denis V. Lunev wrote:
> > > kobject: '<NULL>' (ffffffffa0104050): is not initialized, yet
> > > kobject_put()
> >
> > Thanks Denis.
> >
> > This patch masks a deeper problem; looks like you can't load any modules
> > with CONFIG_SYSFS=n:
> >
> > kernel/module.c:
> > int mod_sysfs_init(struct module *mod)
> > {
> > 	int err;
> > 	struct kobject *kobj;
> >
> > 	if (!module_sysfs_initialized) {
> > 		printk(KERN_ERR "%s: module sysfs not initialized\n",
> > 		       mod->name);
> > 		err = -EINVAL;
> > 		goto out;
> > 	}
> >
> > AFAICT, module_sysfs_initialized is not ever set if !CONFIG_SYSFS.
> >
> > I can't see the point of module_sysfs_initialized.  It was introduced by
> > Greg in commit 823bccfc ("remove "struct subsystem" as it is no longer
> > needed").
> >
> > Greg, what were you trying to do here?  Modules can't be loaded before
> > param_sysfs_init(): are you trying to handle the case where the
> > kset_create_and_add() fails?
>
> Yes.  Previously you were never detecting that if the subsystem was not
> properly created (for whatever reason), we could fail horribly when
> trying to load a module.

Well, my policy is to crash when allocations fail during boot, rather than 
traversing untested code paths.  But since that code already exists, I'm not 
religious enough to argue about it; just wanted to see if there was some 
subtlety I was missing.

> Now we at least detect that problem, is is causing an issue somehow?  I
> think you have now seen that we can load modules with CONFIG_SYSFS=n,
> otherwise people would have complained by now (not that anyone actually
> runs that kind of configuration that I know of...)

Yes, thanks.  But it seems noone has removed a module in such a config since 
April 2007.

The module/sysfs code is messy though: we do most sysfs stuff only under 
CONFIG_SYSFS, which seems overkill since at a glance it should just neatly do 
nothing.  Do you have the cycles and inclination to take a look at it?

Thanks,
Rusty.

  reply	other threads:[~2008-05-23  1:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20  9:59 [PATCH 1/4] proc: proc_get_inode should get module only once Denis V. Lunev
2008-05-20  9:59 ` [PATCH 2/4] pktgen: make sure that pktgen_thread_worker has been executed Denis V. Lunev
2008-05-20 18:30   ` Robert Olsson
2008-05-20 18:43     ` Denis V. Lunev
2008-05-20 19:59       ` Robert Olsson
2008-05-20 22:12   ` David Miller
2008-05-20  9:59 ` [PATCH 3/4] modules: proper cleanup of kobject without CONFIG_SYSFS Denis V. Lunev
2008-05-22  9:20   ` Rusty Russell
2008-05-22 11:44     ` Denis V. Lunev
2008-05-23  1:51       ` Rusty Russell
2008-05-22 17:54     ` Greg KH
2008-05-23  1:34       ` Rusty Russell [this message]
2008-05-20  9:59 ` [PATCH 4/4] flock: remove unused fields from file_lock_operations Denis V. Lunev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200805231134.35462.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=den@openvz.org \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.