set -e
ONLY=${ONLY:-"$*"}
-# bug number for skipped test: 9977/LU-7105 LU-9452
-ALWAYS_EXCEPT=" 28 29 $SANITYN_EXCEPT"
+# bug number for skipped test: 9977/LU-7105
+ALWAYS_EXCEPT=" 28 $SANITYN_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
SRCDIR=$(dirname $0)
touch $DIR1/f2a
ls -l $DIR2/f2a
chmod 777 $DIR2/f2a
- $CHECKSTAT -t file -p 0777 $DIR1/f2a || error
+ $CHECKSTAT -t file -p 0777 $DIR1/f2a ||
+ error "Either not file type or perms not 0777"
}
run_test 2a "check cached attribute updates on 2 mtpt's ========"
touch $DIR1/f2b
ls -l $DIR2/f2b
chmod 777 $DIR1/f2b
- $CHECKSTAT -t file -p 0777 $DIR2/f2b || error
+ $CHECKSTAT -t file -p 0777 $DIR2/f2b ||
+ error "Either not file type or perms not 0777"
}
run_test 2b "check cached attribute updates on 2 mtpt's ========"
# NEED TO SAVE ROOT DIR MODE
test_2c() {
chmod 777 $DIR1
- $CHECKSTAT -t dir -p 0777 $DIR2 || error
+ $CHECKSTAT -t dir -p 0777 $DIR2 ||
+ error "Either not dir type or perms not 0777"
}
run_test 2c "check cached attribute updates on 2 mtpt's root ==="
test_2d() {
chmod 755 $DIR1
- $CHECKSTAT -t dir -p 0755 $DIR2 || error
+ $CHECKSTAT -t dir -p 0755 $DIR2 ||
+ error "Either not file type or perms not 0775"
}
run_test 2d "check cached attribute updates on 2 mtpt's root ==="
ls -l $DIR1
ls -l $DIR2
chmod 777 $DIR1
- $RUNAS dd if=/dev/zero of=$DIR2/$tfile count=1 || error
+ $RUNAS dd if=/dev/zero of=$DIR2/$tfile count=1 ||
+ error "dd failed"
}
run_test 2e "check chmod on root is propagated to others"
local block2=$(stat $DIR2/$tfile | awk '/Blocks/ {print $4} ')
echo "$DIR1/$tfile has $block1 blocks"
echo "$DIR2/$tfile has $block2 blocks"
- [ $block1 -eq $block2 ] || error
+ [ $block1 -eq $block2 ] || error "$block1 not equal to $block2"
}
run_test 2g "check blocks update on sync write"
test_5() {
mcreate $DIR1/f5
$TRUNCATE $DIR2/f5 100
- $CHECKSTAT -t file -s 100 $DIR1/f5 || error
+ $CHECKSTAT -t file -s 100 $DIR1/f5 ||
+ error "Either not file type or size not equal to 100 bytes"
rm $DIR1/f5
}
run_test 5 "create a file on one mount, truncate it on the other"
$DIR2/d11/f
RC=$?
kill -USR1 $MULTIPID
- wait $MULTIPID || error
+ wait $MULTIPID || error "wait for PID $MULTIPID failed"
[ $RC -eq 0 ] && error || true
}
run_test 11 "execution of file opened for write should return error ===="
test_13() { # bug 2451 - directory coherency
test_mkdir $DIR1/d13
- cd $DIR1/d13 || error
+ cd $DIR1/d13 || error "cd to $DIR1/d13 failed"
ls
( touch $DIR1/d13/f13 ) # needs to be a separate shell
ls
- rm -f $DIR2/d13/f13 || error
+ rm -f $DIR2/d13/f13 || error "Cannot remove $DIR2/d13/f13"
ls 2>&1 | grep f13 && error "f13 shouldn't return an error (1)" || true
# need to run it twice
( touch $DIR1/d13/f13 ) # needs to be a separate shell
ls
- rm -f $DIR2/d13/f13 || error
+ rm -f $DIR2/d13/f13 || error "Cannot remove $DIR2/d13/f13"
ls 2>&1 | grep f13 && error "f13 shouldn't return an error (2)" || true
}
run_test 13 "test directory page revocation"
FSXP=100
fi
-test_16() {
+test_16a() {
local file1=$DIR1/$tfile
local file2=$DIR2/$tfile
fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -S 0 -Z -r 4096 \
-w 4096 $file1 $file2 || error "fsx with O_DIRECT failed."
}
-run_test 16 "$FSXNUM iterations of dual-mount fsx"
+run_test 16a "$FSXNUM iterations of dual-mount fsx"
+
+# Consistency check for tiny writes, LU-9409
+test_16b() {
+ local file1=$DIR1/$tfile
+ local file2=$DIR2/$tfile
+
+ # to allocate grant because it may run out due to test_15.
+ lfs setstripe -c -1 $file1
+ dd if=/dev/zero of=$file1 bs=$STRIPE_BYTES count=$OSTCOUNT oflag=sync
+ dd if=/dev/zero of=$file2 bs=$STRIPE_BYTES count=$OSTCOUNT oflag=sync
+ rm -f $file1
+
+ lfs setstripe -c -1 $file1 # b=10919
+ # -o is set to 8192 because writes < 1 page and between 1 and 2 pages
+ # create a mix of tiny writes & normal writes
+ fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -o 8192 -S 0 $file1 \
+ $file2
+}
+run_test 16b "$FSXNUM iterations of dual-mount fsx at small size"
test_17() { # bug 3513, 3667
remote_ost_nodsh && skip "remote OST with nodsh" && return
run_test 25b "change ACL under remote dir on one mountpoint be seen on another"
test_26a() {
- utime $DIR1/f26a -s $DIR2/f26a || error
+ utime $DIR1/f26a -s $DIR2/f26a || error "utime failed for $DIR1/f26a"
}
run_test 26a "allow mtime to get older"
EOF
# reading of 1st stripe should pass
- dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error
+ dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error "dd failed"
# reading of 2nd stripe should fail (this stripe was destroyed)
dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 && error
# now, recreating test file
- dd if=/dev/zero of=$DIR1/$tfile bs=1024k count=2 || error
+ dd if=/dev/zero of=$DIR1/$tfile bs=1024k count=2 || error "dd failed"
# reading of 1st stripe should pass
- dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error
+ dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error "dd failed"
# reading of 2nd stripe should pass
- dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 || error
+ dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 ||
+ error "dd failed"
}
run_test 28 "read/write/truncate file with lost stripes"
-test_29() { # bug 10999
- touch $DIR1/$tfile
- #define OBD_FAIL_LDLM_GLIMPSE 0x30f
- lctl set_param fail_loc=0x8000030f
- ls -l $DIR2/$tfile &
- usleep 500
- dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1
- wait
-}
-#bug 11549 - permanently turn test off in b1_5
-run_test 29 "lock put race between glimpse and enqueue ========="
-
-test_30() { #bug #11110, LU-2523
+test_30() { #b=11110, LU-2523
test_mkdir $DIR1/$tdir
cp -f /bin/bash $DIR1/$tdir/bash
/bin/sh -c 'sleep 1; rm -f $DIR2/$tdir/bash; cp /bin/bash $DIR2/$tdir' &
wait
true
}
-
run_test 30 "recreate file race"
test_31a() {
local br=$(grep -A 10 $tfile /proc/$PID/smaps | awk '/^Rss/{print $2}')
echo "Before revoking layout lock: $br KB mapped"
- # delete the file will revoke layout lock
- rm -f $DIR2/$tfile
+ # cancel layout lock manually
+ cancel_lru_locks mdc
# rss after revoking
local ar=$(grep -A 10 $tfile /proc/$PID/smaps | awk '/^Rss/{print $2}')
kill -USR1 $PID
- wait $PID || error
+ wait $PID || error "wait PID $PID failed"
[ $ar -eq 0 ] || error "rss before: $br, after $ar, some pages remained"
}
}
test_77a() { #LU-3266
+ local rc
+
oss=$(comma_list $(osts_nodes))
- do_nodes $oss lctl set_param ost.OSS.*.nrs_policies="fifo"
+ do_nodes $oss lctl set_param ost.OSS.*.nrs_policies="fifo" ||
+ rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set fifo policy"
nrs_write_read
return 0
run_test 77a "check FIFO NRS policy"
test_77b() { #LU-3266
+ local rc
+
oss=$(comma_list $(osts_nodes))
do_nodes $oss lctl set_param ost.OSS.*.nrs_policies="crrn" \
- ost.OSS.*.nrs_crrn_quantum=1
+ ost.OSS.*.nrs_crrn_quantum=1 || rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set crrn_quantum to 1"
echo "policy: crr-n, crrn_quantum 1"
nrs_write_read
- do_nodes $oss lctl set_param ost.OSS.*.nrs_crrn_quantum=64
+ do_nodes $oss lctl set_param \
+ ost.OSS.*.nrs_crrn_quantum=64 || rc=$?
+ [[ $rc -ne 0 ]] && error "failed to set crrn_quantum to 64"
echo "policy: crr-n, crrn_quantum 64"
nrs_write_read
# cleanup
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="fifo"
+ do_nodes $oss lctl set_param \
+ ost.OSS.ost_io.nrs_policies="fifo" || rc=$?
+ [[ $rc -ne 0 ]] && error "failed to set fifo policy"
return 0
}
run_test 77b "check CRR-N NRS policy"
oss=$(comma_list $(osts_nodes))
do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies=$policy \
- ost.OSS.*.nrs_"$policy"_quantum=1 \
- ost.OSS.*.nrs_"$policy"_offset_type="physical" \
- ost.OSS.*.nrs_"$policy"_supported="reads"
+ ost.OSS.*.nrs_"$policy"_quantum=1 \
+ ost.OSS.*.nrs_"$policy"_offset_type="physical" \
+ ost.OSS.*.nrs_"$policy"_supported="reads" || return $?
- echo "policy: $policy, ${policy}_quantum 1, ${policy}_offset_type physical, ${policy}_supported reads"
+ echo "policy: $policy, ${policy}_quantum 1, ${policy}_offset_type " \
+ "physical, ${policy}_supported reads"
nrs_write_read
- do_nodes $oss lctl set_param ost.OSS.*.nrs_${policy}_supported="writes" \
- ost.OSS.*.nrs_${policy}_quantum=64
+ do_nodes $oss lctl set_param \
+ ost.OSS.*.nrs_${policy}_supported="writes" \
+ ost.OSS.*.nrs_${policy}_quantum=64 || return $?
- echo "policy: $policy, ${policy}_quantum 64, ${policy}_offset_type physical, ${policy}_supported writes"
+ echo "policy: $policy, ${policy}_quantum 64, ${policy}_offset_type " \
+ "physical, ${policy}_supported writes"
nrs_write_read
- do_nodes $oss lctl set_param ost.OSS.*.nrs_${policy}_supported="reads_and_writes" \
- ost.OSS.*.nrs_${policy}_offset_type="logical"
- echo "policy: $policy, ${policy}_quantum 64, ${policy}_offset_type logical, ${policy}_supported reads_and_writes"
+ do_nodes $oss lctl set_param \
+ ost.OSS.*.nrs_${policy}_supported="reads_and_writes" \
+ ost.OSS.*.nrs_${policy}_offset_type="logical" || return $?
+ echo "policy: $policy, ${policy}_quantum 64, ${policy}_offset_type " \
+ "logical, ${policy}_supported reads_and_writes"
nrs_write_read
# cleanup
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="fifo"
+ do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="fifo" ||
+ return $?
return 0
}
test_77c() { #LU-3266
- orr_trr "orr"
+ local rc
+ orr_trr "orr" || rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
+ [[ $rc -ne 0 ]] && error "orr_trr failed rc:$rc"
return 0
}
run_test 77c "check ORR NRS policy"
test_77d() { #LU-3266
- orr_trr "trr"
+ local rc
+ orr_trr "trr" || rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
+ [[ $rc -ne 0 ]] && error "orr_trr failed rc:$rc"
return 0
}
run_test 77d "check TRR nrs policy"
local client1=${CLIENT1:-$(hostname)}
local myRUNAS="$3"
+ local np=$(check_cpt_number ost1)
+ [ $np -gt 0 ] || error "CPU partitions should not be $np."
+ echo "cpu_npartitions on ost1 is $np"
+
mkdir $dir || error "mkdir $dir failed"
- $LFS setstripe -c 1 $dir || error "setstripe to $dir failed"
+ $LFS setstripe -c 1 -i 0 $dir || error "setstripe to $dir failed"
chmod 777 $dir
trap cleanup_tbf_verify EXIT
echo "Limited write rate: $1, read rate: $2"
echo "Verify the write rate is under TBF control"
- local runtime=$(do_node $client1 $myRUNAS dd if=/dev/zero of=$dir/tbf \
- bs=1M count=100 oflag=direct 2>&1 | awk '/bytes/ {print $6}')
+ local start=$SECONDS
+ do_node $client1 $myRUNAS dd if=/dev/zero of=$dir/tbf \
+ bs=1M count=100 oflag=direct 2>&1
+ local runtime=$((SECONDS - start + 1))
local rate=$(bc <<< "scale=6; 100 / $runtime")
echo "Write runtime is $runtime s, speed is $rate IOPS"
- # verify the write rate does not exceed 110% of TBF limited rate
- [ $(bc <<< "$rate < 1.1 * $1") -eq 1 ] ||
- error "The write rate ($rate) exceeds 110% of preset rate ($1)"
+ # verify the write rate does not exceed TBF rate limit
+ [ $(bc <<< "$rate < 1.1 * $np * $1") -eq 1 ] ||
+ error "The write rate ($rate) exceeds 110% of rate limit ($1 * $np)"
cancel_lru_locks osc
echo "Verify the read rate is under TBF control"
- runtime=$(do_node $client1 $myRUNAS dd if=$dir/tbf of=/dev/null \
- bs=1M count=100 iflag=direct 2>&1 | awk '/bytes/ {print $6}')
+ start=$SECONDS
+ do_node $client1 $myRUNAS dd if=$dir/tbf of=/dev/null \
+ bs=1M count=100 iflag=direct 2>&1
+ runtime=$((SECONDS - start + 1))
rate=$(bc <<< "scale=6; 100 / $runtime")
echo "Read runtime is $runtime s, speed is $rate IOPS"
- # verify the read rate does not exceed 110% of TBF limited rate
- [ $(bc <<< "$rate < 1.1 * $2") -eq 1 ] ||
- error "The read rate ($rate) exceeds 110% of preset rate ($2)"
+ # verify the read rate does not exceed TBF rate limit
+ [ $(bc <<< "$rate < 1.1 * $np * $2") -eq 1 ] ||
+ error "The read rate ($rate) exceeds 110% of rate limit ($2 * $np)"
cancel_lru_locks osc
cleanup_tbf_verify || error "rm -rf $dir failed"
}
test_77e() {
- local server_version=$(lustre_version_code ost1)
- [[ $server_version -ge $(version_code 2.7.58) ]] ||
- { skip "Need server version newer than 2.7.57"; return 0; }
+ local rc
oss=$(comma_list $(osts_nodes))
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid"
- [ $? -ne 0 ] && error "failed to set TBF policy"
+ do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid" ||
+ rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS TBF exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set TBF NID policy"
local idis
local rateis
run_test 77e "check TBF NID nrs policy"
test_77f() {
- local server_version=$(lustre_version_code ost1)
- [[ $server_version -ge $(version_code 2.7.58) ]] ||
- { skip "Need server version newer than 2.7.57"; return 0; }
+ local rc
oss=$(comma_list $(osts_nodes))
+ do_nodes $oss $LCTL set_param \
+ ost.OSS.ost_io.nrs_policies="tbf\ jobid" || rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS TBF exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set TBF JOBID policy"
+
# Configure jobid_var
local saved_jobid_var=$($LCTL get_param -n jobid_var)
+ rc=$?
+ [[ $rc -eq 3 ]] && skip "jobid_var not found" && return
+ [[ $rc -ne 0 ]] && error "failed to get param jobid_var"
if [ $saved_jobid_var != procname_uid ]; then
set_conf_param_and_check client \
"$LCTL get_param -n jobid_var" \
"$FSNAME.sys.jobid_var" procname_uid
fi
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ jobid"
- [ $? -ne 0 ] && error "failed to set TBF policy"
-
local idis
local rateis
if [ $(lustre_version_code ost1) -ge $(version_code 2.8.54) ]; then
nrs_write_read "$RUNAS"
local current_jobid_var=$($LCTL get_param -n jobid_var)
+ [[ $? -ne 0 ]] && error "failed to get param jobid_var"
if [ $saved_jobid_var != $current_jobid_var ]; then
set_conf_param_and_check client \
"$LCTL get_param -n jobid_var" \
run_test 77f "check TBF JobID nrs policy"
test_77g() {
- local server_version=$(lustre_version_code ost1)
- [[ $server_version -ge $(version_code 2.7.58) ]] ||
- { skip "Need server version newer than 2.7.57"; return 0; }
+ local rc=0
oss=$(comma_list $(osts_nodes))
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid"
- [ $? -ne 0 ] && error "failed to set TBF policy"
+ do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid" ||
+ rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS TBF exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set TBF NID policy"
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ jobid"
- [ $? -ne 0 ] && error "failed to set TBF policy"
+ do_nodes $oss lctl set_param \
+ ost.OSS.ost_io.nrs_policies="tbf\ jobid" || rc=$?
+ [[ $rc -ne 0 ]] && error "failed to set TBF JOBID policy"
local idis
local rateis
}
test_77i() {
- [ $(lustre_version_code ost1) -ge $(version_code 2.8.55) ] ||
+ [ $(lustre_version_code ost1) -ge $(version_code 2.8.55) ] ||
{ skip "Need OST version at least 2.8.55"; return 0; }
for i in $(seq 1 $OSTCOUNT)
test_77j() {
local idis
local rateis
- if [ $(lustre_version_code ost1) -ge $(version_code 2.8.60) ]; then
+ local ost_version=$(lustre_version_code ost1)
+
+ [ $ost_version -ge $(version_code 2.9.53) ] ||
+ { skip "Need OST version at least 2.9.53"; return 0; }
+ if [ $ost_version -ge $(version_code 2.8.60) ]; then
idis="opcode="
rateis="rate="
fi
run_test 77k "check the extended TBF policy with NID/JobID/OPCode expression"
test_77l() {
+ [[ $(lustre_version_code ost1) -ge $(version_code 2.10.56) ]] ||
+ { skip "Need OST version at least 2.10.56"; return 0; }
+
+ do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid"
+ do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="tbf"
+
+ local output=$(do_facet ost1 lctl get_param \
+ ost.OSS.ost_io.nrs_policies | \
+ awk '/name: tbf/ {print;exit}' | \
+ awk -F ': ' '{print $2}')
+
+ if [ "$output" != "tbf" ]; then
+ error "The generic TBF output is '$output', not 'tbf'"
+ fi
+
+ do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="fifo"
+}
+run_test 77l "check the output of NRS policies for generic TBF"
+
+test_77m() {
if [ $(lustre_version_code ost1) -lt $(version_code 2.9.54) ]; then
skip "Need OST version at least 2.9.54"
return 0
return 0
}
-run_test 77l "check NRS Delay slows write RPC processing"
+run_test 77m "check NRS Delay slows write RPC processing"
test_78() { #LU-6673
- local server_version=$(lustre_version_code ost1)
- [[ $server_version -ge $(version_code 2.7.58) ]] ||
- { skip "Need server version newer than 2.7.57"; return 0; }
-
local rc
oss=$(comma_list $(osts_nodes))
do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="orr" &
do_nodes $oss lctl set_param ost.OSS.*.nrs_orr_quantum=1
rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
# Valid return codes are:
# 0: Tuning succeeded
# ENODEV: Policy is still stopped
# Data-on-MDT tests
test_100a() {
skip "Reserved for glimpse-ahead" && return
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.55) ] &&
+ skip "Need MDS version at least 2.10.55" && return
+
mkdir -p $DIR/$tdir
$LFS setstripe -E 1024K -L mdt -E EOF $DIR/$tdir/dom
run_test 100a "DoM: glimpse RPCs for stat without IO lock (DoM only file)"
test_100b() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.55) ] &&
+ skip "Need MDS version at least 2.10.55" && return
+
mkdir -p $DIR/$tdir
$LFS setstripe -E 1024K -L mdt -E EOF $DIR/$tdir/dom
run_test 100b "DoM: no glimpse RPC for stat with IO lock (DoM only file)"
test_100c() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.55) ] &&
+ skip "Need MDS version at least 2.10.55" && return
+
mkdir -p $DIR/$tdir
$LFS setstripe -E 1024K -L mdt -E EOF $DIR/$tdir/dom
run_test 100c "DoM: write vs stat without IO lock (combined file)"
test_100d() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.55) ] &&
+ skip "Need MDS version at least 2.10.55" && return
+
mkdir -p $DIR/$tdir
$LFS setstripe -E 1024K -L mdt -E EOF $DIR/$tdir/dom
}
run_test 100d "DoM: write+truncate vs stat without IO lock (combined file)"
-
test_101a() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.55) ] &&
+ skip "Need MDS version at least 2.10.55" && return
+
$LFS setstripe -E 1024K -L mdt -E EOF $DIR1/$tfile
- lctl set_param -n mdc.*.stats=clear
# to get layout
$CHECKSTAT -t file $DIR1/$tfile
+
+ OLD_VAL=$(cat /proc/sys/vm/dirty_writeback_centisecs)
+ echo 0 > /proc/sys/vm/dirty_writeback_centisecs
+ echo $OLD_VAL
+
# open + IO lock
- dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 || error "Write fails"
+ dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 ||
+ error_noexit "Write fails"
# must discard pages
- rm $DIR2/$tfile || error "Unlink fails"
+ lctl set_param -n mdc.*.stats=clear
+ rm $DIR2/$tfile || error_noexit "Unlink fails"
local writes=$(lctl get_param -n mdc.*.stats | grep ost_write | wc -l)
+ echo $OLD_VAL > /proc/sys/vm/dirty_writeback_centisecs
+
[ $writes -eq 0 ] || error "Found WRITE RPC but expect none"
}
run_test 101a "Discard DoM data on unlink"
test_101b() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.55) ] &&
+ skip "Need MDS version at least 2.10.55" && return
+
$LFS setstripe -E 1024K -L mdt -E EOF $DIR1/$tfile
touch $DIR1/${tfile}_2
- lctl set_param -n mdc.*.stats=clear
# to get layout
$CHECKSTAT -t file $DIR1/$tfile
+
+ OLD_VAL=$(cat /proc/sys/vm/dirty_writeback_centisecs)
+ echo 0 > /proc/sys/vm/dirty_writeback_centisecs
+ echo $OLD_VAL
+
# open + IO lock
- dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 || error "Write fails"
+ dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 ||
+ error_noexit "Write fails"
# must discard pages
- mv $DIR2/${tfile}_2 $DIR2/$tfile || error "Rename fails"
+ lctl set_param -n mdc.*.stats=clear
+ mv $DIR2/${tfile}_2 $DIR2/$tfile || error_noexit "Rename fails"
local writes=$(lctl get_param -n mdc.*.stats | grep ost_write | wc -l)
+ echo $OLD_VAL > /proc/sys/vm/dirty_writeback_centisecs
[ $writes -eq 0 ] || error "Found WRITE RPC but expect none"
}
run_test 101b "Discard DoM data on rename"
test_101c() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.10.55) ] &&
+ skip "Need MDS version at least 2.10.55" && return
+
$LFS setstripe -E 1024K -L mdt -E EOF $DIR1/$tfile
- lctl set_param -n mdc.*.stats=clear
# to get layout
$CHECKSTAT -t file $DIR1/$tfile
- # open + IO lock
- dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 || error "Write fails"
+ OLD_VAL=$(cat /proc/sys/vm/dirty_writeback_centisecs)
+ echo 0 > /proc/sys/vm/dirty_writeback_centisecs
+ echo $OLD_VAL
+
+ # open + IO lock
+ dd if=/dev/zero of=$DIR1/$tfile bs=4096 count=1 ||
+ error_noexit "Write fails"
$MULTIOP $DIR1/$tfile O_c &
MULTIOP_PID=$!
- sleep 2
- rm $DIR2/$tfile > /dev/null || error "Unlink fails"
- kill -USR1 $MULTIOP_PID || return 2
- wait $MULTIOP_PID || return 3
+ sleep 1
+ lctl set_param -n mdc.*.stats=clear
+ rm $DIR2/$tfile > /dev/null || error_noexit "Unlink fails"
+ kill -USR1 $MULTIOP_PID && wait $MULTIOP_PID ||
+ error_noexit "multiop failure"
local writes=$(lctl get_param -n mdc.*.stats | grep ost_write | wc -l)
+ echo $OLD_VAL > /proc/sys/vm/dirty_writeback_centisecs
[ $writes -eq 0 ] || error "Found WRITE RPC but expect none"
}
run_test 101c "Discard DoM data on close-unlink"