| Summary: | modprobe misunderstands some modaliases and fails to load | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | BitJam |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.21.x | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: |
busybox .config via "busybox bbconfig"
Debug output from modprobe command modules.dep.bb created by busybox |
||
|
Description
BitJam
2014-04-17 18:52:35 UTC
Please attach your .config (In particular, I need to know whether CONFIG_MODPROBE_SMALL is selected). Ah, you are talking about modules.dep.bb, it means you are using
CONFIG_MODPROBE_SMALL=y
I am trying to reproduce this bug.
This is on Fedora 18 machine:
I built current git with CONFIG_MODPROBE_SMALL=y.
Ran "busybox depmod", it generated /lib/modules/3.10.11/modules.dep.bb
and I do have an entry there for pata_via:
kernel/drivers/ata/pata_via.ko pci:v00001106d00009001sv*sd*bc*sc*i* pci:v00001106d0000C409sv*sd*bc*sc*i* pci:v00001106d00005324sv*sd*bc*sc*i* pci:v00001106d00003164sv*sd*bc*sc*i* pci:v00001106d00001571sv*sd*bc*sc*i* pci:v00001106d00000581sv*sd*bc*sc*i* pci:v00001106d00000571sv*sd*bc*sc*i* pci:v00001106d00000415sv*sd*bc*sc*i*
Now I enable debugging in modprobe_small.c:
#if 0 <============ HERE changed to 0
# define dbg1_error_msg(...) ((void)0)
# define dbg2_error_msg(...) ((void)0)
#else
# define dbg1_error_msg(...) bb_error_msg(__VA_ARGS__)
# define dbg2_error_msg(...) bb_error_msg(__VA_ARGS__)
#endif
and I try to modprobe the alias which doesn't work for you:
# ./busybox modprobe pci:v00001106d00000571sv00001509sd00009022bc01sc01i8a
modprobe: loading modules.dep.bb
modprobe: process_module('pci:v00001106d00000571sv00001509sd00009022bc01sc01i8a','(null)')
modprobe: already_loaded:0 is_rmmod:0
modprobe: process_module('pci:v00001106d00000571sv00001509sd00009022bc01sc01i8a'): options:'(null)'
modprobe: find_alias('pci:v00001106d00000571sv00001509sd00009022bc01sc01i8a')
modprobe: found alias 'pci:v00001106d00000571sv00001509sd00009022bc01sc01i8a' in module 'kernel/drivers/ata/pata_via.ko'
modprobe: load_module('kernel/drivers/ata/pata_via.ko','(null)')
modprobe: load_module:0
As you see, it works for me.
In particular, the match triggered here:
/* Does matching substring exist? */
for (s = desc; *s; s += strlen(s) + 1) {
/* Aliases in module bodies can be defined with
* shell patterns. Example:
* "pci:v000010DEd000000D9sv*sd*bc*sc*i*".
* Plain strcmp() won't catch that */
if (fnmatch(s, alias, 0) == 0) {
dbg1_error_msg("found alias '%s' in module '%s'",
alias, modinfo[i].pathname);
result = &modinfo[i];
break;
}
}
Please enable debugging in modprobe_small.c, run modprobe and tell me what it says.
Please try current git.
Please attach your modules.dep.bb.
Created attachment 5342 [details]
busybox .config via "busybox bbconfig"
Yes, CONFIG_MODPROBE_SMALL is selected. I did not think this would matter since the strings involved are the same whether this is selected or not.
I provided the relevant line from modules.dep.bb which AFAIK is only created when CONFIG_MODPROBE_SMALL is set.
(In reply to comment #3) > Created attachment 5342 [details] > busybox .config via "busybox bbconfig" > > Yes, CONFIG_MODPROBE_SMALL is selected. I did not think this would matter > since the strings involved are the same whether this is selected or not. > > I provided the relevant line from modules.dep.bb which AFAIK is only created > when CONFIG_MODPROBE_SMALL is set. It works for me with your .config and with modules.dep.bb containing just one line: kernel/drivers/ata/pata_via.ko pci:v00001106d00009001sv*sd*bc*sc*i* pci:v00001106d0000C409sv*sd*bc*sc*i* pci:v00001106d00005324sv*sd*bc*sc*i* pci:v00001106d00 003164sv*sd*bc*sc*i* pci:v00001106d00001571sv*sd*bc*sc*i* pci:v00001106d00000581sv*sd*bc*sc*i* pci:v00001106d00000571sv*sd*bc*sc*i* pci:v00001106d00000415sv*s d*bc*sc*i* (all on one line) Please enable debugging in modprobe_small.c, run modprobe and tell me what it says. Please try current git. Please attach your modules.dep.bb. Not one line. Entire file. I will do those things but I can't do them instantly. I had already moved on to kmod. I compile busybox on a different system, etc. Created attachment 5348 [details]
Debug output from modprobe command
The alias matches ata_generic.ko and the search seems to end there. Should we not be using this module?
I will also attach modules.dep.bb.
Created attachment 5354 [details]
modules.dep.bb created by busybox
I believe this was with a recent Debian kernel. $ file vmlinuz vmlinuz: Linux kernel x86 boot executable bzImage, version 3.12-0.bpo.1-686-pae (debian-kernel@lists.debian.org) #1 SMP De, RO-rootFS, swap_dev 0x2, Normal VGA We did not maintain the directory structure under /lib/modules/*/. Could this be contributing to the problem? The problem still exits when I use the current git sources. The debug messages look the same but I didn't diff them. It stops after matching ata_generic.ko. Aha, it's a dup of 627. I think I have a fix for that. Please try current git, it has this commit: commit 07e5555a8f7469f6f45cacd7fc188816ae644f74 Author: Denys Vlasenko <vda.linux@googlemail.com> Date: Mon Apr 21 16:59:36 2014 +0200 modprobe-small: (un)load all modules which match the alias, not only first one Closes 627 and 7034. Commonly seen case is (un)loading of an alias which matches ata_generic and a more specific ata module. For example: modprobe [-r] pci:v00008086d00007010sv00000000sd00000000bc01sc01i80 (ata_generic and pata_acpi) modprobe [-r] pci:v00001106d00000571sv00001509sd00009022bc01sc01i8a (ata_generic and pata_via) I will try it. BTW: I did not see bug 627 when I did a search for "modprobe". |