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
}
$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 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
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