[ $MDS1_VERSION -le $(version_code 2.3.55) ] &&
TESTS="4094 4095"
- # skip long symlink name for rhel6.5.
- # rhel6.5 has a limit (PATH_MAX - sizeof(struct filename))
- grep -q '6.5' /etc/redhat-release &>/dev/null &&
- TESTS="59 60 61 4062 4063"
-
for i in $TESTS; do
local SYMNAME=$(str_repeat 'x' $i)
ln -s $SYMNAME $DIR/$tdir/f$i || error "failed $i-char symlink"
run_test 27I "check that root dir striping does not break parent dir one"
test_27J() {
- [[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.12.51) ]] &&
+ [[ $MDS1_VERSION -le $(version_code 2.12.51) ]] &&
skip "Need MDS version newer than 2.12.51"
test_mkdir $DIR/$tdir
run_test 27J "basic ops on file with foreign LOV"
test_27K() {
- [[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.12.49) ]] &&
+ [[ $MDS1_VERSION -le $(version_code 2.12.49) ]] &&
skip "Need MDS version newer than 2.12.49"
test_mkdir $DIR/$tdir
test_65n() {
[ -n "$FILESET" ] && skip "Not functional for FILESET set"
- [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.12.50) ]] ||
+ [[ $MDS1_VERSION -ge $(version_code 2.12.50) ]] ||
skip "Need MDS version at least 2.12.50"
[[ $PARALLEL != "yes" ]] || skip "skip parallel run"
run_test 300q "create remote directory under orphan directory"
test_300r() {
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.7.55) ] &&
+ [ $MDS1_VERSION -lt $(version_code 2.7.55) ] &&
skip "Need MDS version at least 2.7.55" && return
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
}
run_test 319 "lost lease lock on migrate error"
+test_398a() { # LU-4198
+ $LFS setstripe -c 1 -i 0 $DIR/$tfile
+ $LCTL set_param ldlm.namespaces.*.lru_size=clear
+
+ # request a new lock on client
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=1
+
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 oflag=direct conv=notrunc
+ local lock_count=$($LCTL get_param -n \
+ ldlm.namespaces.*-OST0000-osc-ffff*.lru_size)
+ [[ $lock_count -eq 0 ]] || error "lock should be cancelled by direct IO"
+
+ $LCTL set_param ldlm.namespaces.*-OST0000-osc-ffff*.lru_size=clear
+
+ # no lock cached, should use lockless IO and not enqueue new lock
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 oflag=direct conv=notrunc
+ lock_count=$($LCTL get_param -n \
+ ldlm.namespaces.*-OST0000-osc-ffff*.lru_size)
+ [[ $lock_count -eq 0 ]] || error "no lock should be held by direct IO"
+}
+run_test 398a "direct IO should cancel lock otherwise lockless"
+
+test_398b() { # LU-4198
+ which fio || skip_env "no fio installed"
+ $LFS setstripe -c -1 $DIR/$tfile
+
+ local size=12
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=$size
+
+ local njobs=4
+ echo "mix direct rw ${size}M to OST0 by fio with $njobs jobs..."
+ fio --name=rand-rw --rw=randrw --bs=$PAGE_SIZE --direct=1 \
+ --numjobs=$njobs --fallocate=none \
+ --iodepth=16 --allow_file_create=0 --size=$((size/njobs))M \
+ --filename=$DIR/$tfile &
+ bg_pid=$!
+
+ echo "mix buffer rw ${size}M to OST0 by fio with $njobs jobs..."
+ fio --name=rand-rw --rw=randrw --bs=$PAGE_SIZE \
+ --numjobs=$njobs --fallocate=none \
+ --iodepth=16 --allow_file_create=0 --size=$((size/njobs))M \
+ --filename=$DIR/$tfile || true
+ wait $bg_pid
+
+ rm -rf $DIR/$tfile
+}
+run_test 398b "DIO and buffer IO race"
+
+test_398c() { # LU-4198
+ which fio || skip_env "no fio installed"
+
+ saved_debug=$($LCTL get_param -n debug)
+ $LCTL set_param debug=0
+
+ local size=$(lctl get_param -n osc.$FSNAME-OST0000*.kbytesavail | head -1)
+ ((size /= 1024)) # by megabytes
+ ((size /= 2)) # write half of the OST at most
+ [ $size -gt 40 ] && size=40 #reduce test time anyway
+
+ $LFS setstripe -c 1 $DIR/$tfile
+
+ # it seems like ldiskfs reserves more space than necessary if the
+ # writing blocks are not mapped, so it extends the file firstly
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=$size && sync
+ cancel_lru_locks osc
+
+ # clear and verify rpc_stats later
+ $LCTL set_param osc.${FSNAME}-OST0000-osc-ffff*.rpc_stats=clear
+
+ local njobs=4
+ echo "writing ${size}M to OST0 by fio with $njobs jobs..."
+ fio --name=rand-write --rw=randwrite --bs=$PAGE_SIZE --direct=1 \
+ --numjobs=$njobs --fallocate=none --ioengine=libaio \
+ --iodepth=16 --allow_file_create=0 --size=$((size/njobs))M \
+ --filename=$DIR/$tfile
+ [ $? -eq 0 ] || error "fio write error"
+
+ [ $($LCTL get_param -n \
+ ldlm.namespaces.${FSNAME}-OST0000-osc-ffff*.lock_count) -eq 0 ] ||
+ error "Locks were requested while doing AIO"
+
+ # get the percentage of 1-page I/O
+ pct=$($LCTL get_param osc.${FSNAME}-OST0000-osc-ffff*.rpc_stats |
+ grep -A 1 'pages per rpc' | grep -v 'pages per rpc' |
+ awk '{print $7}')
+ [ $pct -le 50 ] || error "$pct% of I/O are 1-page"
+
+ echo "mix rw ${size}M to OST0 by fio with $njobs jobs..."
+ fio --name=rand-rw --rw=randrw --bs=$PAGE_SIZE --direct=1 \
+ --numjobs=$njobs --fallocate=none --ioengine=libaio \
+ --iodepth=16 --allow_file_create=0 --size=$((size/njobs))M \
+ --filename=$DIR/$tfile
+ [ $? -eq 0 ] || error "fio mixed read write error"
+
+ rm -rf $DIR/$tfile
+ $LCTL set_param debug="$saved_debug"
+}
+run_test 398c "run fio to test AIO"
+
test_fake_rw() {
local read_write=$1
if [ "$read_write" = "write" ]; then
test_412() {
[ $MDSCOUNT -lt 2 ] && skip_env "needs >= 2 MDTs"
- if [ $(lustre_version_code mds1) -lt $(version_code 2.10.55) ]; then
+ if [ $MDS1_VERSION -lt $(version_code 2.10.55) ]; then
skip "Need server version at least 2.10.55"
fi
test_415() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
- [ $(lustre_version_code mds1) -lt $(version_code 2.11.52) ] &&
+ [ $MDS1_VERSION -lt $(version_code 2.11.52) ] &&
skip "Need server version at least 2.11.52"
# LU-11102
run_test 415 "lock revoke is not missing"
test_416() {
- [ $(lustre_version_code mds1) -lt $(version_code 2.11.55) ] &&
+ [ $MDS1_VERSION -lt $(version_code 2.11.55) ] &&
skip "Need server version at least 2.11.55"
# define OBD_FAIL_OSD_TXN_START 0x19a
run_test 422 "kill a process with RPC in progress"
prep_801() {
- [[ $(lustre_version_code mds1) -lt $(version_code 2.9.55) ]] ||
+ [[ $MDS1_VERSION -lt $(version_code 2.9.55) ]] ||
[[ $OST1_VERSION -lt $(version_code 2.9.55) ]] &&
skip "Need server version at least 2.9.55"
test_802a() {
[[ $mds1_FSTYPE = zfs ]] || skip "ZFS specific test"
- [[ $(lustre_version_code mds1) -lt $(version_code 2.9.55) ]] ||
+ [[ $MDS1_VERSION -lt $(version_code 2.9.55) ]] ||
[[ $OST1_VERSION -lt $(version_code 2.9.55) ]] &&
skip "Need server version at least 2.9.55"
run_test 810 "partial page writes on ZFS (LU-11663)"
test_811() {
- [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.11.56) ] &&
+ [ $MDS1_VERSION -lt $(version_code 2.11.56) ] &&
skip "Need MDS version at least 2.11.56"
#define OBD_FAIL_MDS_ORPHAN_DELETE 0x165
stop mds1
start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS
- sleep 5
- [[ $(do_facet mds1 pgrep orph_.*-MDD | wc -l) -eq 0 ]] ||
+ wait_update_facet mds1 "pgrep orph_.*-MDD | wc -l" "0" ||
error "MDD orphan cleanup thread not quit"
}
run_test 811 "orphan name stub can be cleaned up in startup"