Bug 922187

Summary: rmmod confused by built-ins
Product: [Fedora] Fedora Reporter: Bryn M. Reeves <bmr>
Component: kmodAssignee: kmod development team <kmod-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 18CC: gansalmon, itamar, jonathan, kernel-maint, kmod-maint, madhu.chinakonda, msivak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 922201 (view as bug list) Environment:
Last Closed: 2013-04-05 00:01:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 922201    

Description Bryn M. Reeves 2013-03-15 17:09:01 UTC
Description of problem:
Attempting to rmmod something that's not actually built as a module now gives a slightly confusing error:

# rmmod loop
libkmod: kmod_module_get_holders: could not open '/sys/module/loop/holders': No such file or directory
Error: Module loop is in use

Previously rmmod from module-init-tools gave a still vague but better "not found" message:

# rmmod ext2
ERROR: Module ext2 does not exist in /proc/modules

Version-Release number of selected component (if applicable):
kmod-*

How reproducible:
100%

Steps to Reproduce:
1. compile something that can be built as a module as a built-in 
2. rmmod $thing


Actual results:
# rmmod loop
libkmod: kmod_module_get_holders: could not open '/sys/module/loop/holders': No such file or directory
Error: Module loop is in use

Which isn't really true: it's not in use, it's simply built in to vmlinuz so unloading makes no sense.

Expected results:
modprobe does the right thing:

# modprobe -r loop
FATAL: Module loop is builtin.


Additional info:
I know rmmod is the low-level tool and users should be using modprobe -r (or just not messing with this in the first place.. :) but knowledge of modprobe to load and rmmod to unload seems much more widespread among admins and the current behaviour looks at first like a kernel bug (if you didn't realise that there are paths directories missing in /sys/modules/$thing and the module name isn't present in /proc/modules you might think some refcount was broken etc.).

Comment 1 Bryn M. Reeves 2013-03-15 17:12:04 UTC
Error is slightly different from 0:12-1.fc18 but same basic problem:

# rmmod loop
rmmod: ERROR: could not open '/sys/module/loop/holders': No such file or directory
rmmod: ERROR: Module loop is in use

Comment 2 Josh Boyer 2013-03-15 17:20:09 UTC
How is this a kernel problem?  libkmod is from the kmod package.

Comment 3 Bryn M. Reeves 2013-03-15 17:32:20 UTC
It's not, sorry - fatfingers. I typed the component and goofed it - fixed.

Comment 5 Josh Boyer 2013-03-18 14:33:42 UTC
Patch was accepted upstream.  I'll submit updates shortly.

Comment 6 Fedora Update System 2013-03-18 15:33:21 UTC
kmod-12-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/kmod-12-2.fc18

Comment 7 Fedora Update System 2013-03-19 20:02:31 UTC
Package kmod-12-2.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kmod-12-2.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-4010/kmod-12-2.fc18
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-04-05 00:02:03 UTC
kmod-12-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.