wait_reintegration() {
local ntype=$1
local qtype=$2
+ local max=$3
local result="glb[1],slv[1],reint[0]"
local varsvc
local cmd
if $(facet_up $SINGLEMDS); then
wait_update_facet $SINGLEMDS "$cmd |
- grep "$qtype" | awk '{ print \\\$3 }'" "$result" ||
- return 1
+ grep "$qtype" | awk '{ print \\\$3 }'" \
+ "$result" $max || return 1
fi
else
local osts=$(get_facets OST)
if $(facet_up $ost); then
wait_update_facet $ost "$cmd |
grep "$qtype" | awk '{ print \\\$3 }'" \
- "$result" || return 1
+ "$result" $max || return 1
fi
done
fi
wait_mdt_reint() {
local qtype=$1
+ local max=${2:-90}
if [ $qtype == "u" ] || [ $qtype == "ug" ]; then
- wait_reintegration "mdt" "user" || return 1
+ wait_reintegration "mdt" "user" $max || return 1
fi
if [ $qtype == "g" ] || [ $qtype == "ug" ]; then
- wait_reintegration "mdt" "group" || return 1
+ wait_reintegration "mdt" "group" $max || return 1
fi
return 0
}
wait_ost_reint() {
local qtype=$1
+ local max=${2:-90}
if [ $qtype == "u" ] || [ $qtype == "ug" ]; then
- wait_reintegration "ost" "user" || return 1
+ wait_reintegration "ost" "user" $max || return 1
fi
if [ $qtype == "g" ] || [ $qtype == "ug" ]; then
- wait_reintegration "ost" "group" || return 1
+ wait_reintegration "ost" "group" $max || return 1
fi
return 0
}
}
quota_init
+resetquota -u $TSTUSR
+resetquota -g $TSTUSR
+resetquota -u $TSTUSR2
+resetquota -g $TSTUSR2
+
test_quota_performance() {
local TESTFILE="$DIR/$tdir/$tfile-0"
local size=$1 # in MB
local MB=100 # 100M
[ "$SLOW" = "no" ] && MB=10
- local free_space=$(lfs df | grep "filesystem summary" | \
- awk '{print $5}')
+ local free_space=$(lfs_df | grep "summary" | awk '{print $4}')
[ $free_space -le $((MB * 1024)) ] &&
skip "not enough space ${free_space} KB, " \
"required $((MB * 1024)) KB" && return
[ "$SLOW" = "no" ] && LIMIT=1024 # 1k inodes
- local FREE_INODES=$(lfs df -i | grep "filesystem summary" | \
- awk '{print $5}')
+ local FREE_INODES=$(lfs_df -i | grep "summary" | awk '{print $4}')
[ $FREE_INODES -lt $LIMIT ] &&
skip "not enough free inodes $FREE_INODES required $LIMIT" &&
return
# define OBD_FAIL_QUOTA_DELAY_REINT 0xa03
lustre_fail ost 0xa03
- # enable ost quota to trigger reintegration
+ # enable ost quota
set_ost_qtype "ug" || error "enable ost quota failed"
+ # trigger reintegration
+ local procf="osd-$(facet_fstype ost1).$FSNAME-OST*."
+ procf=${procf}quota_slave.force_reint
+ $LCTL set_param $procf=1 || "force reintegration failed"
echo "Stop mds..."
stop mds1
start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS
quota_init
- wait_ost_reint "ug" || error "reintegration failed"
+ # wait longer than usual to make sure the reintegration
+ # is triggered by quota wb thread.
+ wait_ost_reint "ug" 200 || error "reintegration failed"
# hardlimit should have been fetched by slave during global
# reintegration, write will exceed quota
trap cleanup_quota_test EXIT
set_ost_qtype "none" || error "disable ost quota failed"
- # LU-2284. Enable trace for debug log.
- do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=+trace"
$LFS setquota -u $TSTUSR -B ${limit}M $DIR ||
error "set quota for $TSTUSR failed"
$LFS setquota -u $TSTUSR2 -B ${limit}M $DIR ||
error "set quota for $TSTUSR2 failed"
- do_nodes $(comma_list $(nodes_list)) "lctl set_param debug=-trace"
#define OBD_FAIL_OBD_IDX_READ_BREAK 0x608
lustre_fail mds 0x608 0
# run for fixing bug10707, it needs a big room. test for 64bit
test_9() {
- local filesize=$((1024 * 1024 * 1024 * 9 / 2)) # 4.5G
+ local filesize=$((1024 * 9 / 2)) # 4.5G
check_whether_skip && return 0