ONLY=${ONLY:-"$*"}
# bug number for skipped test: 13297 2108 9789 3637 9789 3561 12622 12653 12653 5188 16260 19742
-ALWAYS_EXCEPT=" 27u 42a 42b 42c 42d 45 51d 65a 65e 68b 119d 130 $SANITY_EXCEPT"
+ALWAYS_EXCEPT=" 27u 42a 42b 42c 42d 45 51d 65a 65e 68b $SANITY_EXCEPT"
# bug number for skipped test: 2108 9789 3637 9789 3561 5188/5749 1443
#ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-"27m 42a 42b 42c 42d 45 68 76"}
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/${NAME}.sh}
+init_logging
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 24v 27m 36f 36g 51b 51c 60c 63 64b 68 71 73 77f 78 101 103 115 120g 124b"
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 24v 27m 36f 36g 36h 51b 51c 60c 63 64b 68 71 73 77f 78 101 103 115 120g 124b"
SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
FAIL_ON_ERROR=false
local foo=$DIR/$tdir/$tfile
ln -s $foo $foo || error "create symlink failed"
#define OBD_FAIL_MDS_READLINK_EPROTO 0x143
- do_facet mds lctl set_param fail_loc=0x80000144
+ do_facet mds lctl set_param fail_loc=0x80000143
ls -l $foo && error "error not detected"
return 0
}
run_test 27m "create file while OST0 was full =================="
sleep_maxage() {
- local DELAY=$(do_facet mds lctl get_param -n lov.*.qos_maxage | head -n 1 | awk '{print $1 + 5}')
+ local DELAY=$(do_facet mds lctl get_param -n lov.*.qos_maxage | head -n 1 | awk '{print $1 * 2}')
sleep $DELAY
}
do_facet mds${MDSIDX} lctl get_param osc.*OST*-osc-${MDT_INDEX}.prealloc*
- mkdir -p $DIR/d27/${OST}
+ mkdir -p $DIR/$tdir/${OST}
$SETSTRIPE $DIR/$tdir/${OST} -i $OSTIDX -c 1
#define OBD_FAIL_OST_ENOSPC 0x215
do_facet ost$((OSTIDX + 1)) lctl set_param fail_val=$FAILIDX
$LSTRIPE $DIR/$tdir/f0 -s 65536 || error "lstripe failed"
size=`$GETSTRIPE $DIR/$tdir/f0 -s`
[ $size -ne 65536 ] && error "stripe size $size != 65536" || true
+ gsdir=$($LFS getstripe -d $DIR/$tdir)
+ [ $(echo $gsdir | grep -c stripe_count) -ne 1 ] && error "$LFS getstripe -d $DIR/$tdir failed"
[ "$OSTCOUNT" -lt "2" ] && skip_env "skipping multiple stripe count/offset test" && return
for i in `seq 1 $OSTCOUNT`; do
}
run_test 34f "read from a file with no objects until EOF ======="
+test_34g() {
+ dd if=/dev/zero of=$DIR/$tfile bs=1 count=100 seek=$TEST_34_SIZE || error
+ $TRUNCATE $DIR/$tfile $((TEST_34_SIZE / 2))|| error
+ $CHECKSTAT -s $((TEST_34_SIZE / 2)) $DIR/$tfile || error "truncate failed"
+ cancel_lru_locks osc
+ $CHECKSTAT -s $((TEST_34_SIZE / 2)) $DIR/$tfile || \
+ error "wrong size after lock cancel"
+
+ $TRUNCATE $DIR/$tfile $TEST_34_SIZE || error
+ $CHECKSTAT -s $TEST_34_SIZE $DIR/$tfile || \
+ error "expanding truncate failed"
+ cancel_lru_locks osc
+ $CHECKSTAT -s $TEST_34_SIZE $DIR/$tfile || \
+ error "wrong expanded size after lock cancel"
+}
+run_test 34g "truncate long file ==============================="
+
test_35a() {
cp /bin/sh $DIR/f35a
chmod 444 $DIR/f35a
}
run_test 36e "utime on non-owned file (should return error) ===="
-test_36f() {
+subr_36fh() {
+ local fl="$1"
local LANG_SAVE=$LANG
local LC_LANG_SAVE=$LC_LANG
export LANG=C LC_LANG=C # for date language
DATESTR="Dec 20 2000"
mkdir -p $DIR/$tdir
- #define OBD_FAIL_OST_BRW_PAUSE_BULK 0x214
- lctl set_param fail_loc=0x80000214
+ lctl set_param fail_loc=$fl
date; date +%s
cp /etc/hosts $DIR/$tdir/$tfile
sync & # write RPC generated with "current" inode timestamp, but delayed
export LANG=$LANG_SAVE LC_LANG=$LC_LANG_SAVE
}
+
+test_36f() {
+ #define OBD_FAIL_OST_BRW_PAUSE_BULK 0x214
+ subr_36fh "0x80000214"
+}
run_test 36f "utime on file racing with OST BRW write =========="
test_36g() {
}
run_test 36g "filter mod data cache expiry ====================="
+test_36h() {
+ #define OBD_FAIL_OST_BRW_PAUSE_BULK2 0x227
+ subr_36fh "0x80000227"
+}
+run_test 36h "utime on file racing with OST BRW write =========="
+
test_37() {
mkdir -p $DIR/$tdir
echo f > $DIR/$tdir/fbugfile
}
run_test 42d "test complete truncate of file with cached dirty data"
+page_size() {
+ getconf PAGE_SIZE
+}
+
+test_42e() { # bug22074
+ local TDIR=$DIR/${tdir}e
+ local pagesz=$(page_size)
+ local pages=16
+ local files=$((OSTCOUNT * 500)) # hopefully 500 files on each OST
+ local proc_osc0="osc.${FSNAME}-OST0000-osc-[^MDT]*"
+ local max_dirty_mb
+ local warmup_files
+
+ mkdir -p $TDIR
+ $LFS setstripe -c 1 $TDIR
+ createmany -o $TDIR/f $files
+
+ max_dirty_mb=$($LCTL get_param -n $proc_osc0/max_dirty_mb)
+
+ # we assume that with $OSTCOUNT files, at least one of them will
+ # be allocated on OST0.
+ warmup_files=$((OSTCOUNT * max_dirty_mb))
+ createmany -o $TDIR/w $warmup_files
+
+ # write a large amount of data into one file and sync, to get good
+ # avail_grant number from OST.
+ for ((i=0; i<$warmup_files; i++)); do
+ idx=$($LFS getstripe -i $TDIR/w$i)
+ [ $idx -ne 0 ] && continue
+ dd if=/dev/zero of=$TDIR/w$i bs="$max_dirty_mb"M count=1
+ break
+ done
+ [ $i -gt $warmup_files ] && error "OST0 is still cold"
+ sync
+ $LCTL get_param $proc_osc0/cur_dirty_bytes
+ $LCTL get_param $proc_osc0/cur_grant_bytes
+
+ # create as much dirty pages as we can while not to trigger the actual
+ # RPCs directly. but depends on the env, VFS may trigger flush during this
+ # period, hopefully we are good.
+ for ((i=0; i<$warmup_files; i++)); do
+ idx=$($LFS getstripe -i $TDIR/w$i)
+ [ $idx -ne 0 ] && continue
+ dd if=/dev/zero of=$TDIR/w$i bs=1M count=1 2>/dev/null
+ done
+ $LCTL get_param $proc_osc0/cur_dirty_bytes
+ $LCTL get_param $proc_osc0/cur_grant_bytes
+
+ # perform the real test
+ $LCTL set_param $proc_osc0/rpc_stats 0
+ for ((;i<$files; i++)); do
+ [ $($LFS getstripe -i $TDIR/f$i) -eq 0 ] || continue
+ dd if=/dev/zero of=$TDIR/f$i bs=$pagesz count=$pages 2>/dev/null
+ done
+ sync
+ $LCTL get_param $proc_osc0/rpc_stats
+
+ $LCTL get_param $proc_osc0/rpc_stats |
+ while read PPR RRPC RPCT RCUM BAR WRPC WPCT WCUM; do
+ [ "$PPR" != "16:" ] && continue
+ [ $WPCT -lt 85 ] && error "$pages-page write RPCs only $WPCT% < 85%"
+ break # we only want the "pages per rpc" stat
+ done
+ rm -rf $TDIR
+}
+run_test 42e "verify sub-RPC writes are not done synchronously"
+
test_43() {
mkdir -p $DIR/$tdir
cp -p /bin/ls $DIR/$tdir/$tfile
}
run_test 45 "osc io page accounting ============================"
-page_size() {
- getconf PAGE_SIZE
-}
-
# in a 2 stripe file (lov.sh), page 1023 maps to page 511 in its object. this
# test tickles a bug where re-dirtying a page was failing to be mapped to the
# objects offset and an assert hit when an rpc was built with 1023's mapped
link $DIR/d52a/foo $DIR/d52a/foo_link 2>/dev/null && error "link worked"
echo foo >> $DIR/d52a/foo || error "append foo failed"
mrename $DIR/d52a/foo $DIR/d52a/foo_ren && error "rename worked"
- lsattr $DIR/d52a/foo | egrep -q "^-+[ae]-+ $DIR/d52a/foo" || error "lsattr"
+ lsattr $DIR/d52a/foo | egrep -q "^-+a[-e]+ $DIR/d52a/foo" || error "lsattr"
chattr -a $DIR/d52a/foo || error "chattr -a failed"
cp -r $DIR/d52a /tmp/
rm -fr $DIR/d52a || error "cleanup rm failed"
mrename $DIR/d52b/foo $DIR/d52b/foo_ren && error "rename worked"
[ -f $DIR/d52b/foo ] || error
[ -f $DIR/d52b/foo_ren ] && error
- lsattr $DIR/d52b/foo | egrep -q "^-+[ie]-+ $DIR/d52b/foo" || error "lsattr"
+ lsattr $DIR/d52b/foo | egrep -q "^-+i[-e]+ $DIR/d52b/foo" || error "lsattr"
chattr -i $DIR/d52b/foo || error "chattr failed"
rm -fr $DIR/d52b || error
}
run_test 103 "acl test ========================================="
-test_104() {
+test_104a() {
touch $DIR/$tfile
lfs df || error "lfs df failed"
lfs df -ih || error "lfs df -ih failed"
lfs df || error "lfs df with reactivated OSC failed"
rm -f $DIR/$tfile
}
-run_test 104 "lfs df [-ih] [path] test ========================="
+run_test 104a "lfs df [-ih] [path] test ========================="
+
+test_104b() {
+ [ $RUNAS_ID -eq $UID ] && skip_env "RUNAS_ID = UID = $UID -- skipping" && return
+ chmod 666 /dev/obd
+ denied_cnt=$((`$RUNAS $LFS check servers 2>&1 | grep "Permission denied" | wc -l`))
+ if [ $denied_cnt -ne 0 ];
+ then
+ error "lfs check servers test failed"
+ fi
+}
+run_test 104b "$RUNAS lfs check servers test ===================="
test_105a() {
# doesn't work on 2.4 kernels
test_163() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
- copytool --test || { skip "copytool not runnable: $?" && return; }
- copytool &
+ copytool --test $FSNAME || { skip "copytool not runnable: $?" && return; }
+ copytool $FSNAME &
sleep 1
local uuid=$($LCTL get_param -n mdc.${FSNAME}-MDT0000-mdc-*.uuid)
# this proc file is temporary and linux-only
- do_facet mds lctl set_param mdt.${FSNAME}-MDT0000.mdccomm=$uuid || error "lnl send failed"
- kill $!
+ do_facet mds lctl set_param mdt.${FSNAME}-MDT0000.mdccomm=$uuid ||\
+ error "kernel->userspace send failed"
+ kill -INT $!
}
-run_test 163 "LustreNetLink kernelcomms"
+run_test 163 "kernel <-> userspace comms"
test_169() {
# do directio so as not to populate the page cache