Whamcloud - gitweb
b=19867
authoranserper <anserper>
Tue, 16 Jun 2009 19:56:50 +0000 (19:56 +0000)
committeranserper <anserper>
Tue, 16 Jun 2009 19:56:50 +0000 (19:56 +0000)
i=Yong Fan

quota_save_version fixes

lustre/tests/cfg/local.sh
lustre/tests/sanity-quota.sh
lustre/tests/test-framework.sh

index b454382..dceb554 100644 (file)
@@ -45,7 +45,7 @@ DEBUG_SIZE=${DEBUG_SIZE:-10}
 SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
 
 ENABLE_QUOTA=${ENABLE_QUOTA:-""}
 SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
 
 ENABLE_QUOTA=${ENABLE_QUOTA:-""}
-QUOTA_TYPE="ug"
+QUOTA_TYPE="ug3"
 QUOTA_USERS=${QUOTA_USERS:-"quota_usr quota_2usr sanityusr sanityusr1"}
 
 MKFSOPT=""
 QUOTA_USERS=${QUOTA_USERS:-"quota_usr quota_2usr sanityusr sanityusr1"}
 
 MKFSOPT=""
index 007bc52..6d54952 100644 (file)
@@ -1804,7 +1804,7 @@ test_21() {
 run_test_with_stat 21 "run for fixing bug16053 ==========="
 
 test_22() {
 run_test_with_stat 21 "run for fixing bug16053 ==========="
 
 test_22() {
-        quota_save_version "ug"
+        quota_save_version "ug3"
 
         stopall
         mount
 
         stopall
         mount
@@ -1812,8 +1812,8 @@ test_22() {
 
         echo "checking parameters"
 
 
         echo "checking parameters"
 
-        do_facet $SINGLEMDS "lctl get_param mdd.${FSNAME}-MDT*.quota_type" | grep "ug" || error "admin failure"
-        do_facet ost1 "lctl get_param obdfilter.*.quota_type" | grep "ug" || error "op failure"
+        do_facet $SINGLEMDS "lctl get_param mdd.${FSNAME}-MDT*.quota_type" | grep "ug3" || error "admin failure"
+        do_facet ost1 "lctl get_param obdfilter.*.quota_type" | grep "ug3" || error "op failure"
 
         run_test 0 "reboot lustre"
 }
 
         run_test 0 "reboot lustre"
 }
index d17bf3c..606fe64 100644 (file)
@@ -521,16 +521,21 @@ stop() {
 # add an additional parameter if mountpoint is ever different from $MOUNT
 quota_save_version() {
     local fsname=${2:-$FSNAME}
 # add an additional parameter if mountpoint is ever different from $MOUNT
 quota_save_version() {
     local fsname=${2:-$FSNAME}
+    local spec=$1
+    local ver=$(tr -c -d "123" <<< $spec)
+    local type=$(tr -c -d "ug" <<< $spec)
+
+    [ -n "$ver" -a "$ver" != "3" ] && error "wrong quota version specifier"
 
     $LFS quotaoff -ug $MOUNT # just in case
 
     $LFS quotaoff -ug $MOUNT # just in case
-    [ -n "$1" ] && { $LFS quotacheck -$1 $MOUNT || error "quotacheck has failed"; }
+    [ -n "$type" ] && { $LFS quotacheck -$type $MOUNT || error "quotacheck has failed"; }
 
 
-    do_facet mgs "lctl conf_param ${fsname}-MDT*.mdd.quota_type=$1"
+    do_facet mgs "lctl conf_param ${fsname}-MDT*.mdd.quota_type=$spec"
     local varsvc
     local osts=$(get_facets OST)
     for ost in ${osts//,/ }; do
         varsvc=${ost}_svc
     local varsvc
     local osts=$(get_facets OST)
     for ost in ${osts//,/ }; do
         varsvc=${ost}_svc
-        do_facet mgs "lctl conf_param ${!varsvc}.ost.quota_type=$1"
+        do_facet mgs "lctl conf_param ${!varsvc}.ost.quota_type=$spec"
     done
 }
 
     done
 }