Bug 512892 - mkinitrd can add modules multiple times
Summary: mkinitrd can add modules multiple times
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: mkinitrd
Version: 5.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Brian Lane
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks: 726828
TreeView+ depends on / blocked
 
Reported: 2009-07-21 08:43 UTC by Issue Tracker
Modified: 2018-11-26 19:35 UTC (History)
6 users (show)

Fixed In Version: mkinitrd-5.1.19.6-73
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-21 05:33:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0157 0 normal SHIPPED_LIVE mkinitrd bug fix update 2012-02-20 14:54:17 UTC

Description Issue Tracker 2009-07-21 08:43:12 UTC
Escalated to Bugzilla from IssueTracker

Comment 1 Issue Tracker 2009-07-21 08:43:14 UTC
Event posted on 2009-07-21 07:33 BST by pyaduvan

Description of problem: Customer installed RHEL5.3 on ASUS P6T7 motherboard, after reboot system shows following messages at boot time :

PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
PCI: Not using MMCONFIG
Red Hat nash version 5.1.19.6 starting
insmod: error inserting '/lib/raid456.ko': -1 File exists
insmod: error inserting '/lib/raid456.ko': -1 File exists

Above messages are not creating nay functional issue to the system however the customer need this fixed as they want to move the system to production.

How reproducible: Always

Steps to Reproduce: 
Install RHEL 5.3 with RAID5 device created at install time.
Create multiple RAID5 devices.
Reboot the system.
Error message will appear at boot time.

Actual results: System boots fine with error message.

Expected results: System should boot normally without the error message.

Additional info:

Test Environment :

1. If I install RHEL5u3 on a non-RAID filesystem and create RAID5 filesystems later (I created three md0, md1, md2), I am unable to see any such message during bootup. The init script in initrd image have no mention of the module being added, nor the raid456.ko module is present in the modules library of the image.

2. If I create two RAID5 filesystems during installation (/ and swap), during booting, I see the message "insmod: error inserting '/lib/raid456.ko': -1 File exists" once. The init script shows that the module raid456.ko getting added twice.

2a. If after the above installation I create more RAID5 filesystems and create a new initrd image and boot with it, the message still shows up once (as it was before), the number of RAID5 filesystems created after installation does not have any effect on the number of occurrence of the message.

So, it seems that if two RAID5 are created during installation, raid456.ko module gets loaded for the first md device, and for the second, it prints the message once. If three RAID5 are created, the message prints twice (for the second and third md). But if RAID5 filesystems are created after installation, it has no effect on the message.
This event sent from IssueTracker by mpoole  [SEG - Base OS]
 issue 320216

Comment 2 Martin Poole 2009-07-21 08:48:45 UTC
Problem is most easily triggered by having multiple raid devices of the same level.

The code inserted in the initrd image will attempt to load the relevant raid module for each device, causing the error message on 2nd and subsequent occurences.

Although there is a comment in the mkinitrd script regarding eliminating duplicates there is no code.

    # only need to add each module once
    MODULES="$MODULES $fmPath"

Current upstream has the following at this point

    # only need to add each module once
    case " $(eval echo \${$modlist}) " in
        *" $modName "*)
            return ;;
        *)
            eval $modlist=\"\${$modlist} $modName\"
            ;;
    esac

Obviously there has been some refactoring which needs to be accounted for, but the elimination code seems sound.

Comment 3 Martin Poole 2009-07-21 10:37:56 UTC
The upstream seems to be only adding the module name to the list if not duplicate whereas the RHEL5 code is using the full path.  Assuming there is still a 1-1 relationship involved this probably makes the de-dupe for RHEL5 something like


    # only need to add each module once
    case " $MODULES " in
        *" $fmPath "*)
            return ;;
        *)
            MODULES="$MODULES $fmPath"
            ;;
    esac

Comment 8 RHEL Program Management 2011-08-05 12:33:48 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 Jan Stodola 2012-01-02 09:11:22 UTC
Reproduced with mkinitrd-5.1.19.6-71.el5 and three RAID5 devices:

...
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
Warning: pci_mmcfg_init marking 256MB space uncacheable.
ed Hat nash version 5.1.19.6 starting
insmod: error inserting '/lib/raid456.ko': -1 File exists
insmod: error inserting '/lib/raid456.ko': -1 File exists
raid5: raid level 5 set md1 active with 2 out of 3 devices, algorithm 2
                Welcome to Red Hat Enterprise Linux Server
                Press 'I' to enter interactive startup.
...

After creating new initramdisk using updated mkinitrd (mkinitrd-5.1.19.6-75.el5) and rebooting, there were no error messages.

Also unable to reproduce with clean installation of RHEL-5.8 Snapshot 2 (mkinitrd-5.1.19.6-75.el5) and three RAID5 devices.


Moving to VERIFIED.

Comment 11 errata-xmlrpc 2012-02-21 05:33:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0157.html


Note You need to log in before you can comment on or make changes to this bug.