}
run_test 38 "open a regular file with O_DIRECTORY should return -ENOTDIR ==="
-test_39() {
+test_39a() { # was test_39
touch $DIR/$tfile
touch $DIR/${tfile}2
# ls -l $DIR/$tfile $DIR/${tfile}2
error "O_TRUNC didn't change timestamps"
fi
}
-run_test 39 "mtime changed on create ==========================="
+run_test 39a "mtime changed on create ==========================="
test_39b() {
test_mkdir -p -c1 $DIR/$tdir
}
run_test 42e "verify sub-RPC writes are not done synchronously"
-test_43() {
+test_43A() { # was test_43
test_mkdir -p $DIR/$tdir
cp -p /bin/ls $DIR/$tdir/$tfile
$MULTIOP $DIR/$tdir/$tfile Ow_c &
$DIR/$tdir/$tfile && error || true
kill -USR1 $pid
}
-run_test 43 "execution of file opened for write should return -ETXTBSY"
+run_test 43A "execution of file opened for write should return -ETXTBSY"
test_43a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
}
run_test 43c "md5sum of copy into lustre========================"
-test_44() {
+test_44A() { # was test_44
[[ $OSTCOUNT -lt 2 ]] && skip_env "skipping 2-stripe test" && return
dd if=/dev/zero of=$DIR/f1 bs=4k count=1 seek=1023
dd if=$DIR/f1 bs=4k count=1 > /dev/null
}
-run_test 44 "zero length read from a sparse stripe ============="
+run_test 44A "zero length read from a sparse stripe ============="
test_44a() {
local nstripe=$($LCTL lov_getconfig $DIR | grep default_stripe_count: |
rm -f $LLOOP
unset LLOOP
fi
- if [ ! -z "$LLITELOOPLOAD" ]; then
- rmmod llite_lloop
- unset LLITELOOPLOAD
- fi
rm -f $DIR/f68*
}
swapon -s | awk '($1 == "'$1'") { print $4 }'
}
-# test case for lloop driver, basic function
-test_68a() {
- [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- [ "$UID" != 0 ] && skip_env "must run as root" && return
- llite_lloop_enabled || \
- { skip_env "llite_lloop module disabled" && return; }
-
- trap cleanup_68 EXIT
-
- if ! module_loaded llite_lloop; then
- if load_module llite/llite_lloop; then
- LLITELOOPLOAD=yes
- else
- skip_env "can't find module llite_lloop"
- return
- fi
- fi
-
- LLOOP=$TMP/lloop.`date +%s`.`date +%N`
- dd if=/dev/zero of=$DIR/f68a bs=4k count=1024
- $LCTL blockdev_attach $DIR/f68a $LLOOP || error "attach failed"
-
- directio rdwr $LLOOP 0 1024 4096 || error "direct write failed"
- directio rdwr $LLOOP 0 1025 4096 && error "direct write should fail"
-
- cleanup_68
-}
-run_test 68a "lloop driver - basic test ========================"
-
-# excercise swapping to lustre by adding a high priority swapfile entry
-# and then consuming memory until it is used.
-test_68b() { # was test_68
- [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- [ "$UID" != 0 ] && skip_env "must run as root" && return
- lctl get_param -n devices | grep -q obdfilter && \
- skip "local OST" && return
-
- grep -q llite_lloop /proc/modules
- [ $? -ne 0 ] && skip "can't find module llite_lloop" && return
-
- [ -z "`$LCTL list_nids | grep -v tcp`" ] && \
- skip "can't reliably test swap with TCP" && return
-
- MEMTOTAL=`meminfo MemTotal`
- NR_BLOCKS=$((MEMTOTAL>>8))
- [[ $NR_BLOCKS -le 2048 ]] && NR_BLOCKS=2048
-
- LLOOP=$TMP/lloop.`date +%s`.`date +%N`
- dd if=/dev/zero of=$DIR/f68b bs=64k seek=$NR_BLOCKS count=1
- mkswap $DIR/f68b
-
- $LCTL blockdev_attach $DIR/f68b $LLOOP || error "attach failed"
-
- trap cleanup_68 EXIT
-
- swapon -p 32767 $LLOOP || error "swapon $LLOOP failed"
-
- echo "before: `swapon -s | grep $LLOOP`"
- $MEMHOG $MEMTOTAL || error "error allocating $MEMTOTAL kB"
- echo "after: `swapon -s | grep $LLOOP`"
- SWAPUSED=`swap_used $LLOOP`
-
- cleanup_68
-
- [ $SWAPUSED -eq 0 ] && echo "no swap used???" || true
-}
-run_test 68b "support swapping to Lustre ========================"
-
# bug5265, obdfilter oa2dentry return -ENOENT
# #define OBD_FAIL_SRV_ENOENT 0x217
test_69() {
}
test_102n() { # LU-4101 mdt: protect internal xattrs
- local file0=$DIR/$tfile.0
- local file1=$DIR/$tfile.1
- local xattr0=$TMP/$tfile.0
- local xattr1=$TMP/$tfile.1
- local name
- local value
-
[ -z "$(which setfattr 2>/dev/null)" ] &&
skip "could not find setfattr" && return
-
if [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.50) ]
then
skip "MDT < 2.5.50 allows setxattr on internal trusted xattrs"
return
fi
+ local file0=$DIR/$tfile.0
+ local file1=$DIR/$tfile.1
+ local xattr0=$TMP/$tfile.0
+ local xattr1=$TMP/$tfile.1
+ local namelist="lov lma lmv link fid version som hsm"
+ local name
+ local value
+
rm -rf $file0 $file1 $xattr0 $xattr1
touch $file0 $file1
# Get 'before' xattrs of $file1.
getfattr --absolute-names --dump --match=- $file1 > $xattr0
- for name in lov lma lmv link fid version som hsm; do
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.8.53) ] &&
+ namelist+=" lfsck_namespace"
+ for name in $namelist; do
# Try to copy xattr from $file0 to $file1.
value=$(getxattr $file0 trusted.$name 2> /dev/null)
SAVE_UMASK=$(umask)
umask 0022
- cd $DIR
+ mkdir -p $DIR/$tdir
+ cd $DIR/$tdir
echo "performing cp ..."
run_acl_subtest cp || error "run_acl_subtest cp failed"
stat $DIR/$tdir $DIR/$tdir/f1 > /dev/null
# XXX client can not do early lock cancel of OST lock
# during unlink (LU-4206), so cancel osc lock now.
+ sleep 2
cancel_lru_locks osc
can1=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
stat $DIR/$tdir/d1 $DIR/$tdir/d2 $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2 > /dev/null
# XXX client can not do early lock cancel of OST lock
# during rename (LU-4206), so cancel osc lock now.
+ sleep 2
cancel_lru_locks osc
can1=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
NR=$(($(default_lru_size)*20))
if [[ $NR -gt $LIMIT ]]; then
- log "Limit lock number by $LIMIT locks"
- NR=$LIMIT
- fi
- lru_resize_disable mdc
- test_mkdir -p $DIR/$tdir/disable_lru_resize ||
+ log "Limit lock number by $LIMIT locks"
+ NR=$LIMIT
+ fi
+
+ IFree=$(mdsrate_inodes_available)
+ if [ $IFree -lt $NR ]; then
+ log "Limit lock number by $IFree inodes"
+ NR=$IFree
+ fi
+
+ lru_resize_disable mdc
+ test_mkdir -p $DIR/$tdir/disable_lru_resize ||
error "failed to create $DIR/$tdir/disable_lru_resize"
createmany -o $DIR/$tdir/disable_lru_resize/f $NR
cmd="mv -f $DIR/$tfile $DIR/$tdir.rename"
verify_jobstats "$cmd" "$SINGLEMDS"
# jobstats expiry - sleep until old stats should be expired
- local left=$((interval_new + 2 - (SECONDS - start)))
- [ $left -ge 0 ] && echo "sleep $left for expiry" && sleep $((left + 1))
+ local left=$((interval_new + 5 - (SECONDS - start)))
+ [ $left -ge 0 ] && wait_update_facet $SINGLEMDS \
+ "lctl get_param *.*.job_stats | grep -c 'job_id.*mkdir'" \
+ "0" $left
cmd="mkdir $DIR/$tdir.expire"
verify_jobstats "$cmd" "$SINGLEMDS"
[ $(do_facet $SINGLEMDS lctl get_param *.*.job_stats |
done
}
-test_241() {
+test_241a() { # was test_241
dd if=/dev/zero of=$DIR/$tfile count=1 bs=40960
ls -la $DIR/$tfile
cancel_lru_locks osc
test_241_dio 1000
wait $PID
}
-run_test 241 "bio vs dio"
+run_test 241a "bio vs dio"
test_241b() {
dd if=/dev/zero of=$DIR/$tfile count=1 bs=40960
}
test_255b() {
- lfs setstripe -c -1 -i 0 $DIR/$tfile
-
ladvise_no_type dontneed $DIR/$tfile &&
skip "dontneed ladvise is not supported" && return
[ "$(facet_fstype ost1)" = "zfs" ] &&
skip "zfs-osd does not support dontneed advice" && return
+ lfs setstripe -c 1 -i 0 $DIR/$tfile
+
local size_mb=100
local size=$((size_mb * 1048576))
# In order to prevent disturbance of other processes, only check 3/4