Bug 319 - `modprobe -r` doesnt work
Summary: `modprobe -r` doesnt work
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.14.x
Hardware: PC Linux
: P5 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-06 00:33 UTC by Mike Frysinger
Modified: 2009-05-28 04:26 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Fix. (807 bytes, patch)
2009-05-26 12:36 UTC, Denys Vlasenko
Details
Additional fix (1.67 KB, patch)
2009-05-28 01:44 UTC, Denys Vlasenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Frysinger 2009-05-06 00:33:43 UTC
root:/> modprobe snd-pcm
root:/> lsmod
Module                  Size  Used by    Not tainted
snd_pcm                47348  0
snd_page_alloc          4404  1 snd_pcm
snd_timer              14144  1 snd_pcm
snd                    32580  2 snd_pcm,snd_timer
soundcore               3848  1 snd

root:/> modprobe -r snd-pcm
root:/> lsmod
Module                  Size  Used by    Not tainted
snd_pcm                47348  0
snd_page_alloc          4404  1 snd_pcm
snd_timer              14144  1 snd_pcm
snd                    32580  2 snd_pcm,snd_timer
soundcore               3848  1 snd

root:/> rmmod snd-pcm
root:/> lsmod
Module                  Size  Used by    Not tainted
snd_page_alloc          4404  0
snd_timer              14144  0
snd                    32580  1 snd_timer
soundcore               3848  1 snd

this is current git (2b6497ba84a3c6...), with allnoconfig, and then just the module stuff turned on:

$ grep =y .config
CONFIG_HAVE_DOT_CONFIG=y
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
CONFIG_NO_DEBUG_LIB=y
CONFIG_INSTALL_APPLET_SYMLINKS=y
CONFIG_INSMOD=y
CONFIG_RMMOD=y
CONFIG_LSMOD=y
CONFIG_MODPROBE=y
CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
CONFIG_FEATURE_MODUTILS_ALIAS=y
CONFIG_FEATURE_MODUTILS_SYMBOLS=y
CONFIG_FEATURE_SH_IS_NONE=y
Comment 1 Denys Vlasenko 2009-05-25 23:47:56 UTC
Please attach your .config
Comment 2 Mike Frysinger 2009-05-26 02:44:38 UTC
i posted my .config.  look at the end of my summary comment.
Comment 3 Denys Vlasenko 2009-05-26 12:36:31 UTC
Created attachment 353 [details]
Fix.

Thanks, I reproduced it.

Please try this fix, or try latest git.
Comment 4 Mike Frysinger 2009-05-26 22:54:14 UTC
maybe i'm missing something, but it doesnt seem to work for me ...

here's the modules.dep file snippet:
kernel/net/irda/ircomm/ircomm-tty.ko: kernel/net/irda/ircomm/ircomm.ko kernel/net/irda/irda.ko kernel/lib/crc-ccitt.ko
kernel/net/irda/ircomm/ircomm.ko: kernel/net/irda/irda.ko kernel/lib/crc-ccitt.ko
kernel/net/irda/irda.ko: kernel/lib/crc-ccitt.ko
kernel/lib/crc-ccitt.ko:

root:/> lsmod
    Not tainted
root:/> modprobe ircomm-tty
root:/> lsmod
    Not tainted
ircomm_tty 16628 0 - Live 0x02b08000
ircomm 7472 1 ircomm_tty, Live 0x02b54000
irda 81268 2 ircomm_tty,ircomm, Live 0x02b60000
crc_ccitt 1136 1 irda, Live 0x0292f800

root:/> modprobe -r ircomm-tty
modprobe: failed to unload module ircomm-tty: unknown symbol in module, or unknown parameter
root:/> lsmod
    Not tainted
ircomm 7472 0 - Live 0x02b54000
irda 81268 1 ircomm, Live 0x02b60000
crc_ccitt 1136 1 irda, Live 0x0292f800
root:/> rmmod ircomm
root:/> rmmod irda
root:/> rmmod crc_ccitt
root:/> lsmod
    Not tainted

running the `modprobe -r` step through strace shows that it tries to delete the module twice:
delete_module("ircomm_tty") = 0
delete_module("ircomm_tty") = -1 ENOENT (No such file or directory)
Comment 5 Denys Vlasenko 2009-05-28 01:44:20 UTC
Created attachment 359 [details]
Additional fix

Reproduced that also. Please try attached patch.
Comment 6 Mike Frysinger 2009-05-28 04:26:18 UTC
seems to be working for me now, thanks