Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Lustre 2.1.0
-
None
-
RHEL6 based
-
3
-
5004
Description
The function module_loaded can easily produce false positives based on it's lenient way of grep'ing the output of lsmod.
Tightening up the regex can improve upon this.
For example, if checking to see if the 'ost' module is loaded.. It will report true if another module is already loaded and has 'ost' anywhere in its name (i.e. vhost_net).
Function's match criteria could mort strict to avoid this kind of problem:
module_loaded() {
lsmod | grep ^$1 # Or perhaps even '^\b$1\b'
}
I will submit a patch to gerrit soon.