# test setting directory atime to future
touch -a -d @$TEST_39_ATIME $DIR/$tdir
local atime=$(stat -c %X $DIR/$tdir)
- [ "$atime" = $TEST_39_ATIME ] || \
+ [ "$atime" = $TEST_39_ATIME ] ||
error "atime is not set to future: $atime, $TEST_39_ATIME"
# test setting directory atime from future to now
- local d1=$(date +%s)
- ls $DIR/$tdir
- local d2=$(date +%s)
+ local now=$(date +%s)
+ touch -a -d @$now $DIR/$tdir
- cancel_lru_locks mdc
atime=$(stat -c %X $DIR/$tdir)
- [ "$atime" -ge "$d1" -a "$atime" -le "$d2" ] || \
- error "atime is not updated from future: $atime, $d1<atime<$d2"
+ [ "$atime" -eq "$now" ] ||
+ error "atime is not updated from future: $atime, $now"
do_facet $SINGLEMDS lctl set_param -n mdd.*MDT0000*.atime_diff=2
sleep 3
# test setting directory atime when now > dir atime + atime_diff
- d1=$(date +%s)
+ local d1=$(date +%s)
ls $DIR/$tdir
- d2=$(date +%s)
+ local d2=$(date +%s)
cancel_lru_locks mdc
atime=$(stat -c %X $DIR/$tdir)
- [ "$atime" -ge "$d1" -a "$atime" -le "$d2" ] || \
+ [ "$atime" -ge "$d1" -a "$atime" -le "$d2" ] ||
error "atime is not updated : $atime, should be $d2"
do_facet $SINGLEMDS lctl set_param -n mdd.*MDT0000*.atime_diff=60
ls $DIR/$tdir
cancel_lru_locks mdc
atime=$(stat -c %X $DIR/$tdir)
- [ "$atime" -ge "$d1" -a "$atime" -le "$d2" ] || \
+ [ "$atime" -ge "$d1" -a "$atime" -le "$d2" ] ||
error "atime is updated to $atime, should remain $d1<atime<$d2"
do_facet $SINGLEMDS \
run_test 39p "remote directory cached attributes updated after create ========"
+test_39p() { # LU-8041
+ local testdir=$DIR/$tdir
+ mkdir -p $testdir
+ multiop_bg_pause $testdir D_c || error "multiop failed"
+ local multipid=$!
+ cancel_lru_locks mdc
+ kill -USR1 $multipid
+ local atime=$(stat -c %X $testdir)
+ [ "$atime" -ne 0 ] || error "atime is zero"
+}
+run_test 39p "close won't zero out atime"
+
test_40() {
dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1
$RUNAS $OPENFILE -f O_WRONLY:O_TRUNC $DIR/$tfile &&
}
run_test 101f "check mmap read performance"
+test_101g() {
+ local rpcs
+ local osts=$(get_facets OST)
+ local list=$(comma_list $(osts_nodes))
+ local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
+
+ save_lustre_params $osts "obdfilter.*.brw_size" > $p
+
+ $LFS setstripe -c 1 $DIR/$tfile
+
+ if [ $(lustre_version_code ost1) -ge $(version_code 2.8.52) ]; then
+ set_osd_param $list '' brw_size 16M
+
+ echo "remount client to enable large RPC size"
+ remount_client $MOUNT || error "remount_client failed"
+
+ for mp in $($LCTL get_param -n osc.*.max_pages_per_rpc); do
+ [ "$mp" -eq 4096 ] ||
+ error "max_pages_per_rpc not correctly set"
+ done
+
+ $LCTL set_param -n osc.*.rpc_stats=0
+
+ # 10*16 MiB should be enough for the test
+ dd if=/dev/zero of=$DIR/$tfile bs=16M count=10
+ cancel_lru_locks osc
+ dd of=/dev/null if=$DIR/$tfile bs=16M count=10
+
+ # calculate 16 MiB RPCs
+ rpcs=$($LCTL get_param 'osc.*.rpc_stats' |
+ sed -n '/pages per rpc/,/^$/p' |
+ awk 'BEGIN { sum = 0 }; /4096:/ { sum += $2 };
+ END { print sum }')
+ echo $rpcs RPCs
+ [ "$rpcs" -eq 10 ] || error "not all RPCs are 16 MiB BRW rpcs"
+ fi
+
+ echo "set RPC size to 4MB"
+
+ $LCTL set_param -n osc.*.max_pages_per_rpc=4M osc.*.rpc_stats=0
+ dd if=/dev/zero of=$DIR/$tfile bs=4M count=25
+ cancel_lru_locks osc
+ dd of=/dev/null if=$DIR/$tfile bs=4M count=25
+
+ # calculate 4 MiB RPCs
+ rpcs=$($LCTL get_param 'osc.*.rpc_stats' |
+ sed -n '/pages per rpc/,/^$/p' |
+ awk 'BEGIN { sum = 0 }; /1024:/ { sum += $2 };
+ END { print sum }')
+ echo $rpcs RPCs
+ [ "$rpcs" -eq 25 ] || error "not all RPCs are 4 MiB BRW rpcs"
+
+ restore_lustre_params < $p
+ remount_client $MOUNT || error "remount_client failed"
+
+ rm -f $p $DIR/$tfile
+}
+run_test 101g "Big bulk(4/16 MiB) readahead"
+
setup_test102() {
test_mkdir -p $DIR/$tdir
chown $RUNAS_ID $DIR/$tdir
# Get 'before' xattrs of $file1.
getfattr --absolute-names --dump --match=- $file1 > $xattr0
- for name in lov lma lmv link fid version som hsm lfsck_namespace; do
+ for name in lov lma lmv link fid version som hsm; do
# Try to copy xattr from $file0 to $file1.
value=$(getxattr $file0 trusted.$name 2> /dev/null)