Whamcloud - gitweb
LU-544 speed up filesystem formatting time in conf-sanity.sh
authorYu Jian <yujian@whamcloud.com>
Fri, 12 Aug 2011 09:08:20 +0000 (17:08 +0800)
committerJohann Lombardi <johann@whamcloud.com>
Mon, 29 Aug 2011 11:15:08 +0000 (07:15 -0400)
Pass "-E lazy_itable_init" to mke2fs to speed up Lustre
filesystem formatting time in conf-sanity.sh.

Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: I2df0e47332b967deae668405786006c7ad7250bd
Reviewed-on: http://review.whamcloud.com/1223
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/tests/conf-sanity.sh

index e2704ee..4effcd6 100644 (file)
@@ -41,6 +41,16 @@ MDSSIZE=40000
 OSTSIZE=40000
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 
+# pass "-E lazy_itable_init" to mke2fs to speed up the formatting time
+for facet in MGS MDS OST; do
+    opts=${facet}_MKFS_OPTS
+    if [[ ${!opts} != *lazy_itable_init* ]]; then
+        eval SAVED_${facet}_MKFS_OPTS=\"${!opts}\"
+        eval ${facet}_MKFS_OPTS=\"${!opts} \
+--mkfsoptions='\\\"-E lazy_itable_init\\\"'\"
+    fi
+done
+
 require_dsh_mds || exit 0
 require_dsh_ost || exit 0
 
@@ -2279,14 +2289,11 @@ not $file_size"
 run_test 55 "check lov_objid size"
 
 test_56() {
-       add mds $MDS_MKFS_OPTS \
-               --mkfsoptions='\"-J size=8 -E lazy_itable_init\"' \
+       add mds $MDS_MKFS_OPTS --mkfsoptions='\"-J size=8\"' \
                --reformat $MDSDEV || error "failed to reformat mds"
-       add ost1 $OST_MKFS_OPTS --mkfsoptions='\"-E lazy_itable_init\"' \
-               --index=1000 --reformat $(ostdevname 1) || \
+       add ost1 $OST_MKFS_OPTS --index=1000 --reformat $(ostdevname 1) || \
                error "failed to reformat ost1"
-       add ost2 $OST_MKFS_OPTS --mkfsoptions='\"-E lazy_itable_init\"' \
-               --index=10000 --reformat $(ostdevname 2) || \
+       add ost2 $OST_MKFS_OPTS --index=10000 --reformat $(ostdevname 2) || \
                error "failed to reformat ost2"
 
        start_mds
@@ -2406,5 +2413,13 @@ if ! combined_mgs_mds ; then
        stop mgs
 fi
 
+# restore the ${facet}_MKFS_OPTS variables
+for facet in MGS MDS OST; do
+    opts=SAVED_${facet}_MKFS_OPTS
+    if [[ -n ${!opts} ]]; then
+        eval ${facet}_MKFS_OPTS=\"${!opts}\"
+    fi
+done
+
 complete $(basename $0) $SECONDS
 exit_status