Whamcloud - gitweb
LU-409: only load llite_lloop module if kernel < 2.6.32 or LOAD_LLOOP
authorRichard Henwood <rhenwood@whamcloud.com>
Wed, 22 Jun 2011 02:38:28 +0000 (22:38 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 22 Jun 2011 15:38:49 +0000 (08:38 -0700)
The change of block device interface in kernel 2.6.32-131 caused
the llite_lloop module to fail. llite_lloop module is currently
unsupported. This change introduces a test for kernel version
to prohibit loading a module with a kernel >= 2.6.32. A LOAD_LLOOP
flag (default false) is provided to ignore the kernel test and force
loading of llite_lloop if desired.

A related version of this change for b1_8 is:
http://review.whamcloud.com/954

Change-Id: I63ebc7a8e0a8de6d34ffce5fd625df6db7216d32
Signed-off-by: Richard Henwood <rhenwood@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/956
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/test-framework.sh

index 14547a1..392536a 100644 (file)
@@ -16,6 +16,10 @@ export GSS_PIPEFS=false
 export IDENTITY_UPCALL=default
 export QUOTA_AUTO=1
 
+# LOAD_LLOOP: LU-409: only load llite_lloop module if kernel < 2.6.32 or
+#             LOAD_LLOOP is true. LOAD_LLOOP is false by default.
+export LOAD_LLOOP=${LOAD_LLOOP:-false}
+
 #export PDSH="pdsh -S -Rssh -w"
 
 # function used by scripts run on remote nodes
@@ -364,8 +368,21 @@ load_modules_local() {
         load_module obdfilter/obdfilter
     fi
 
+    load_module_llite_lloop() {
+        local n1=$(uname -r | cut -d. -f1)
+        local n2=$(uname -r | cut -d. -f2)
+        local n3=$(uname -r | cut -d- -f1 | cut -d. -f3)
+
+    # load the llite_lloop module for < 2.6.32 kernels
+        if [[ $n1 -lt 2 ]] || [[ $n1 -eq 2 && $n2 -lt 6 ]] || \
+            [[ $n1 -eq 2 && $n2 -eq 6 && $n3 -lt 32 ]] || \
+            $LOAD_LLOOP; then
+                load_module llite/llite_lloop
+        fi
+    }
+
     load_module llite/lustre
-    load_module llite/llite_lloop
+    load_module_llite/llite_lloop
     [ -d /r ] && OGDB=${OGDB:-"/r/tmp"}
     OGDB=${OGDB:-$TMP}
     rm -f $OGDB/ogdb-$HOSTNAME