Bug 175315

Summary: RFE: don't try loading a given module more than once
Product: [Fedora] Fedora Reporter: Nalin Dahyabhai <nalin>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: rvokal
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-31 21:46:34 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:

Description Nalin Dahyabhai 2005-12-08 20:16:15 UTC
Description of problem:
While trying to isolate a problem, I modified rc.sysinit to print the name of
the module which is being loaded by load_module() and noticed that duplicates
aren't screened out.

Version-Release number of selected component (if applicable):
8.18-1

How reproducible:
Always

Steps to Reproduce:
1. Have load_module() print the name of the module before attempting to load it.
2. Reboot.
  
Actual results:
You may end up getting duplicates (if you have multiple on-board USB
controllers, for example).

Expected results:
Not to see that, maybe a negligibly faster bootup.

Additional info:
(Ab)using $blacklist by adding names of modules to it as we attempt to load it
appears to do the trick:

@@ -197,6 +197,7 @@
        for module in $blacklist ; do
                [ "$1" = "$module" ] && return
        done
+       blacklist="$blacklist $1"
        modprobe $1 >/dev/null 2>&1
 }

Comment 1 Bill Nottingham 2005-12-08 22:27:18 UTC
This is going to get moved to udev shortly, actually.

Comment 2 Bill Nottingham 2006-01-31 21:46:34 UTC
load_module is dead. Hooray.