On Fri, Jan 25, 2008 at 10:44:59AM -0800, Linus Torvalds wrote:Ok, in looking at the code, this should also be showing up for you on a "clean" 2.6.24 release, I didn't change anything in this code path. That is what taints your kernel with the "F" flag. This is the sysfs core telling you that someone did something stupid :) Yes, that's new, but the "error" was always there, I just made the warning more visible to get people to pay attention to it, and find the real errors where this happens (and it has found them, which is a good thing.) But in this case, it doesn't look like the module loading code will detect that we are trying to load a module that is already present until the kobjects are set up here. It's been this way for a long time :( Rusty, any ideas of us adding a different check for "duplicate" modules like this earlier in the load_module() function, so we don't spend so much effort in building everything up when we don't need to? I think it's down in the apply_relocate() function where we would finally figure out that something bad is going on here, which seems a bit late to me. I guess we could just check the list of module names loaded when we try to set up the kobject, that would be simple and easy. Linus, does the patch below (built tested only) fix the above call trace noise for you? It shouldn't change the taint flag, that's a different issue it seems. thanks, greg k-h --------------------- From: Greg Kroah-Hartman <gregkh@suse.de> Subject: module: bail out of loading duplicate modules early This should fix the long calltrace when trying to load a module that has been built into the kernel allready. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> diff --git a/kernel/module.c b/kernel/module.c index dcb8a2c..3a76a4d 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1210,6 +1210,7 @@ void module_remove_modinfo_attrs(struct module *mod) 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", @@ -1217,6 +1218,15 @@ int mod_sysfs_init(struct module *mod) err = -EINVAL; goto out; } + + kobj = kset_find_obj(module_kset, mod->name); + if (kobj) { + printk(KERN_ERR "%s: module is already loaded\n", mod->name); + kobject_put(kobj); + err = -EINVAL; + goto out; + } + mod->mkobj.mod = mod; memset(&mod->mkobj.kobj, 0, sizeof(mod->mkobj.kobj)); --
| Michal Piotrowski | Re: Linux 2.6.21-rc4 |
| Satyam Sharma | [PATCH 0/8] i386: bitops: Cleanup, sanitize, optimize |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| David Woodhouse | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Alexey Dobriyan | Re: [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
