. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/${NAME}.sh}
-get_lustre_env
+
init_logging
# 5 12 (min)"
test_120a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
- test_mkdir $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip_env "no early lock cancel on server"
cancel_lru_locks osc
stat $DIR/$tdir > /dev/null
- can1=$(do_facet $SINGLEMDS \
+ can1=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
- test_mkdir -c1 $DIR/$tdir/d1
- can2=$(do_facet $SINGLEMDS \
+ test_mkdir -i0 -c1 $DIR/$tdir/d1
+ can2=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
test_120c() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
- test_mkdir -c1 $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip "no early lock cancel on server"
lru_resize_disable mdc
lru_resize_disable osc
- test_mkdir -c1 $DIR/$tdir/d1
- test_mkdir -c1 $DIR/$tdir/d2
+ test_mkdir -i0 -c1 $DIR/$tdir/d1
+ test_mkdir -i0 -c1 $DIR/$tdir/d2
touch $DIR/$tdir/d1/f1
cancel_lru_locks mdc
stat $DIR/$tdir/d1 $DIR/$tdir/d2 $DIR/$tdir/d1/f1 > /dev/null
- can1=$(do_facet $SINGLEMDS \
+ can1=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
ln $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2
- can2=$(do_facet $SINGLEMDS \
+ can2=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
test_120d() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
- test_mkdir -c1 $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip_env "no early lock cancel on server"
touch $DIR/$tdir
cancel_lru_locks mdc
stat $DIR/$tdir > /dev/null
- can1=$(do_facet $SINGLEMDS \
+ can1=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
chmod a+x $DIR/$tdir
- can2=$(do_facet $SINGLEMDS \
+ can2=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
local dlmtrace_set=false
- test_mkdir -c1 $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
lru_resize_disable mdc
lru_resize_disable osc
! $LCTL get_param debug | grep -q dlmtrace &&
# during unlink (LU-4206), so cancel osc lock now.
sleep 2
cancel_lru_locks osc
- can1=$(do_facet $SINGLEMDS \
+ can1=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
unlink $DIR/$tdir/f1
sleep 5
- can2=$(do_facet $SINGLEMDS \
+ can2=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
skip_env "no early lock cancel on server"
remote_mds_nodsh && skip "remote MDS with nodsh"
- test_mkdir -c1 $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
lru_resize_disable mdc
lru_resize_disable osc
- test_mkdir -c1 $DIR/$tdir/d1
- test_mkdir -c1 $DIR/$tdir/d2
+ test_mkdir -i0 -c1 $DIR/$tdir/d1
+ test_mkdir -i0 -c1 $DIR/$tdir/d2
dd if=/dev/zero of=$DIR/$tdir/d1/f1 count=1
dd if=/dev/zero of=$DIR/$tdir/d2/f2 count=1
cancel_lru_locks mdc
# during rename (LU-4206), so cancel osc lock now.
sleep 2
cancel_lru_locks osc
- can1=$(do_facet $SINGLEMDS \
+ can1=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
mrename $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2
sleep 5
- can2=$(do_facet $SINGLEMDS \
+ can2=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
do_facet $SINGLEMDS $LCTL --version)"
log "OSS: $(do_facet ost1 $LCTL lustre_build_version 2> /dev/null ||
do_facet ost1 $LCTL --version)"
+
+ get_lustre_env
}
log_test() {
test_mkdir() {
local path
local p_option
- local stripe_count=2
- local stripe_index=-1
+ local dirstripe_count=${DIRSTRIPE_COUNT:-"-1"}
+ local dirstripe_index=${DIRSTRIPE_INDEX:-"-1"}
local OPTIND=1
while getopts "c:i:p" opt; do
case $opt in
- c) stripe_count=$OPTARG;;
- i) stripe_index=$OPTARG;;
+ c) dirstripe_count=$OPTARG;;
+ i) dirstripe_index=$OPTARG;;
p) p_option="-p";;
\?) error "only support -i -c -p";;
esac
if [ $MDSCOUNT -le 1 ]; then
mkdir $path || error "mkdir '$path' failed"
else
- local test_num=$(echo $testnum | sed -e 's/[^0-9]*//g')
local mdt_index
- if [ $stripe_index -eq -1 ]; then
- mdt_index=$((test_num % MDSCOUNT))
+ if [ $dirstripe_index -eq -1 ]; then
+ mdt_index=$((RANDOM % MDSCOUNT))
+ else
+ mdt_index=$dirstripe_index
+ fi
+
+ if (($MDS1_VERSION >= $(version_code 2.8.0))); then
+ if [ $dirstripe_count -eq -1 ]; then
+ dirstripe_count=$((RANDOM % MDSCOUNT + 1))
+ fi
else
- mdt_index=$stripe_index
+ dirstripe_count=1
fi
- echo "striped dir -i$mdt_index -c$stripe_count $path"
- $LFS mkdir -i$mdt_index -c$stripe_count $path ||
- error "mkdir -i $mdt_index -c$stripe_count $path failed"
+
+ echo "striped dir -i$mdt_index -c$dirstripe_count $path"
+ $LFS mkdir -i$mdt_index -c$dirstripe_count $path ||
+ error "mkdir -i $mdt_index -c$dirstripe_count $path failed"
fi
}