Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 477089

Summary: weak-modules --remove-modules add same modules as compatible module
Product: Red Hat Enterprise Linux 5 Reporter: Joe Jin <joe.jin>
Component: module-init-toolsAssignee: Jon Masters <jcm>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: low Docs Contact:
Priority: low    
Version: 5.3CC: ajb, amyagi, deepak.patel, gerhart, martin.wilck, mgahagan, phil, ykopkova
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:25:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for this issue none

Description Joe Jin 2008-12-19 01:32:07 UTC
Created attachment 327398 [details]
Patch for this issue

Description of problem:

Call weak-modules with --remove-modules, found sometime it could not remove the modules links.
after script finished. checked weak-modules found when remove-modules, it try to found a compatible
modules instead remove links, but it was not check if remove module links as same as compatible module.
    
The patch will resolve it, please review.

Comment 1 Jon Masters 2009-03-13 19:29:38 UTC
Not sure exactly what is being requested as I think you're referring to intended behavior.

Comment 2 Joe Jin 2009-03-16 02:35:41 UTC
When script weak-module with "--remove-module" tried to remove weak module, 
if system just exist one compatible module, it will re-added will remove module 
as compatible module again.

For example, system have installed kmod-xenpv package, the package built based
kernel 2.6.18-53, OS kernel running kernel is 2.6.18-92, then when installed 
kmod-xenpv it will add all modules of kmod-xenpv pkg as weak module at 
/lib/module/2.6.18-92/weak-modules/xenpv/0.1-9/*

# rpm -q kmod-xenpv-0.1-9

Then I try to remove all weak module with weak-module:

# modules=( $(rpm -ql kmod-xenpv-0.1-9 | grep '\.ko$') )
# printf '%s\n' "${modules[@]}" | /sbin/weak-modules --remove-modules

after above commands finished, check /lib/modules/2.6.18-92/weak-modules/xenpv/* found
weak module still existed and not removed by the script.

Please check it.

Thanks,
Joe

Comment 3 Björn Gerhart 2009-05-07 09:35:51 UTC
> The patch will resolve it, please review.

Behaviour of unpatched weak-modules:

original kernel module location:
/lib/modules/2.6.18-92.el5/extra/wn/wn_javapos_portio.ko
weak modules link after calling --add-modules:
/lib/modules/2.6.18-92.1.18.1.wn.el5/weak-updates/wn/wn_javapos_portio.ko

After calling
$ echo '/lib/modules/2.6.18-92.el5/extra/wn/wn_javapos_portio.ko' | /sbin/weak-modules --remove-modules
..the link is not removed.


After applying your patch, removing the link with the "--remove-modules" command works properly.

Comment 10 errata-xmlrpc 2010-03-30 08:25:05 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0242.html

Comment 11 Jon Masters 2010-05-19 00:11:01 UTC
This fix happens to break upgrades of existing kmods. It's not done often, but it is causing problems for e.g. the ELrepo folks. So we expect to have to respin this as a Zstream: http://elrepo.org/bugs/view.php?id=64

Comment 12 Martin Wilck 2010-07-16 13:29:26 UTC
Please see https://bugzilla.redhat.com/show_bug.cgi?id=593504#c21. This change should never have been applied. It is wrong.

Comment 13 Jon Masters 2010-07-28 10:07:32 UTC
I am inclined to agree. This should never have been done, and it will be corrected.