Merge of master-melb:xfs-cmds:26631a by kenmcd.
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 123
+#
+# Make sure user cannot overwrite, append, delete or move a file created by
+# root. Modified CXFSQA test 940960 and 940558.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=ajones@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=0 # success is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd $testdir
+ rm data_coherency.txt
+ cd /
+ _cleanup_testdir
+}
+
+_user_do()
+{
+ echo $1 | su - $qa_user | sed -e "s#.*Permission denied.*#Permission denied#g"
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux IRIX
+
+_require_user
+
+_setup_testdir
+
+echo foo > $testdir/data_coherency.txt
+# check basic appending to a file
+echo bar >> $testdir/data_coherency.txt
+
+
+# try append
+_user_do "echo goo 2>&1 >> $testdir/data_coherency.txt"
+
+# try overwrite
+_user_do "echo goo 2>&1 > $testdir/data_coherency.txt"
+
+# try delete
+_user_do "rm $testdir/data_coherency.txt 2>&1"
+
+# try move
+_user_do "mv $testdir/data_coherency.txt $testdir/data_coherency2.txt 2>&1"
+
+cat $testdir/data_coherency.txt
+
+
+exit
--- /dev/null
+QA output created by 123
+Permission denied
+Permission denied
+Permission denied
+Permission denied
+foo
+bar
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 124
+#
+# Test preallocated_rw_pattern_test modified from CXFSQA test preallocated_rw_pattern_test
+#
+# pat stands for pattern. First 8 bytes contains the 64-bit number 0,
+# second is 1, ..., until last 8 bytes (1048568-1048575) contain 131071.
+# patw preallocates the file and then writes the pattern, patr checks it
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=ajones@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux
+
+_setup_testdir
+_require_scratch
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+
+# Run preallo_rw_pattern on both test and scratch partitions
+for TESTFILE in $testdir/rw_pattern.tmp $SCRATCH_MNT/rw_pattern.tmp
+ do
+ count=1
+ while (( count < 101 ))
+ do
+ src/preallo_rw_pattern_writer $TESTFILE
+ src/preallo_rw_pattern_reader $TESTFILE
+ if (test $? -ne 0) then
+ echo Read/Write Pattern Test FAILED.
+ _cleanup
+ exit 1
+ fi
+ rm $TESTFILE
+ ((count=count+1))
+ done #done for count of 100
+done
+
+if (test $? -eq 0 ) then
+ status=0
+fi
+
+umount $SCRATCH_DEV
+
+_check_test_fs
+_check_scratch_fs
+
+exit
--- /dev/null
+QA output created by 124
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 125
+#
+# ftruncate test, modified from CXFSQA tests cxfs_ftrunc and cxfs_trunc
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=ajones@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux
+
+_require_user
+
+_setup_testdir
+
+TESTDIR=$testdir/ftrunc
+TESTFILE=$TESTDIR/ftrunc.tmp
+
+[ -d $TESTDIR ] && rm -r $TESTDIR
+mkdir $TESTDIR
+
+# ftrunc must be run as a mortal user.
+touch $TESTFILE
+
+chmod a+rw $TESTDIR
+chmod a+rw $TESTFILE
+
+su $qa_user -c "$here/src/ftrunc -f $TESTFILE"
+
+if [ "$?" != "0" ]; then
+ echo src/ftrunc returned non 0 status!
+fi
+
+src/trunc -f $TESTFILE
+if (test $? -eq 0 ) then
+ status=0
+fi
+
+exit
--- /dev/null
+QA output created by 125
+direct write of 1's into file
+buffered write of 2's into file
+truncate file
+sync buffered data (2's)
+iterate direct reads for 60s or until failure...
+Passed
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 126
+#
+# tests various file permission options modified from CXFSQA test fs_perms
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=allanr@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux
+
+_require_user
+_setup_testdir
+
+QA_FS_PERMS=$here/src/fs_perms
+
+cd $testdir
+cp $here/src/testx ./testx.file
+
+# file_perm owner_uid owner_gid tester_uid tester_gid perm_to_test expected_result pass=1
+$QA_FS_PERMS 001 99 99 12 100 x 1
+$QA_FS_PERMS 010 99 99 200 99 x 1
+$QA_FS_PERMS 100 99 99 99 500 x 1
+$QA_FS_PERMS 002 99 99 12 100 w 1
+$QA_FS_PERMS 020 99 99 200 99 w 1
+$QA_FS_PERMS 200 99 99 99 500 w 1
+$QA_FS_PERMS 004 99 99 12 100 r 1
+$QA_FS_PERMS 040 99 99 200 99 r 1
+$QA_FS_PERMS 400 99 99 99 500 r 1
+$QA_FS_PERMS 000 99 99 99 99 r 1
+$QA_FS_PERMS 000 99 99 99 99 w 1
+$QA_FS_PERMS 000 99 99 99 99 x 1
+$QA_FS_PERMS 010 99 99 99 500 x 1
+$QA_FS_PERMS 100 99 99 200 99 x 1
+$QA_FS_PERMS 020 99 99 99 500 w 1
+$QA_FS_PERMS 200 99 99 200 99 w 1
+$QA_FS_PERMS 040 99 99 99 500 r 1
+$QA_FS_PERMS 400 99 99 200 99 r 1
+
+status=0
+_cleanup
+exit
--- /dev/null
+QA output created by 126
+x a 001 file owned by (99/99) as user/group(12/100) PASS
+x a 010 file owned by (99/99) as user/group(200/99) PASS
+x a 100 file owned by (99/99) as user/group(99/500) PASS
+w a 002 file owned by (99/99) as user/group(12/100) PASS
+w a 020 file owned by (99/99) as user/group(200/99) PASS
+w a 200 file owned by (99/99) as user/group(99/500) PASS
+r a 004 file owned by (99/99) as user/group(12/100) PASS
+r a 040 file owned by (99/99) as user/group(200/99) PASS
+r a 400 file owned by (99/99) as user/group(99/500) PASS
+r a 000 file owned by (99/99) as user/group(99/99) FAIL
+w a 000 file owned by (99/99) as user/group(99/99) FAIL
+x a 000 file owned by (99/99) as user/group(99/99) FAIL
+x a 010 file owned by (99/99) as user/group(99/500) FAIL
+x a 100 file owned by (99/99) as user/group(200/99) FAIL
+w a 020 file owned by (99/99) as user/group(99/500) FAIL
+w a 200 file owned by (99/99) as user/group(200/99) FAIL
+r a 040 file owned by (99/99) as user/group(99/500) FAIL
+r a 400 file owned by (99/99) as user/group(200/99) FAIL
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 127
+#
+# fsx tests modified from CXFSQA tests
+# - fsx_00_lite
+# - fsx_05_lite_mmap
+# - fsx_10_std,
+# - fsx_15_std_mmap
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=allanr@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+FSX_FILE_SIZE=262144
+FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
+
+_fsx_lite_nommap()
+{
+ echo "=== FSX Light Mode, No Memory Mapping ==="
+ dd if=/dev/zero of=$testdir/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+ if ! ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap > $tmp.output 2>&1
+ then
+ echo "ltp/fsx $FSX_ARGS -L -R -W $testdir/fsx_lite_nommap"
+ cat $tmp.output
+ return 1
+ fi
+ cat $tmp.output
+ return 0
+}
+
+_fsx_lite_mmap()
+{
+ echo "=== FSX Light Mode, Memory Mapping ==="
+ dd if=/dev/zero of=$testdir/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
+ if ! ltp/fsx $FSX_ARGS -L $testdir/fsx_lite_mmap > $tmp.output 2>&1
+ then
+ echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
+ cat $tmp.output
+ return 1
+ fi
+ cat $tmp.output
+ return 0
+}
+
+_fsx_std_nommap()
+{
+ echo "=== FSX Standard Mode, No Memory Mapping ==="
+ if ! ltp/fsx $FSX_ARGS -R -W $testdir/fsx_std_nommap > $tmp.output 2>&1
+ then
+ echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
+ cat $tmp.output
+ return 1
+ fi
+ cat $tmp.output
+ return 0
+}
+
+_fsx_std_mmap()
+{
+ echo "=== FSX Standard Mode, Memory Mapping ==="
+ if ! ltp/fsx $FSX_ARGS $testdir/fsx_std_mmap > $tmp.output 2>&1
+ then
+ echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
+ cat $tmp.output
+ return 1
+ fi
+ cat $tmp.output
+ return 0
+}
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux
+
+_require_user
+_setup_testdir
+
+_fsx_lite_nommap
+_fsx_lite_mmap
+
+_fsx_std_nommap
+_fsx_std_mmap
+
+#flush cache after write
+FSX_ARGS="-f $FSX_ARGS"
+_fsx_std_nommap
+_fsx_std_mmap
+
+
+status=0
+_cleanup
+exit
--- /dev/null
+QA output created by 127
+=== FSX Light Mode, No Memory Mapping ===
+All operations completed A-OK!
+=== FSX Light Mode, Memory Mapping ===
+All operations completed A-OK!
+=== FSX Standard Mode, No Memory Mapping ===
+All operations completed A-OK!
+=== FSX Standard Mode, Memory Mapping ===
+All operations completed A-OK!
+=== FSX Standard Mode, No Memory Mapping ===
+All operations completed A-OK!
+=== FSX Standard Mode, Memory Mapping ===
+All operations completed A-OK!
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 128
+#
+# Test nosuid mount option modified from CXFSQA test mount_option_nosuid
+#
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=allanr@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux
+
+_setup_testdir
+_require_scratch
+_require_user
+
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount "-o nosuid"
+
+mkdir $SCRATCH_MNT/nosuid
+cp `which ls` $SCRATCH_MNT
+chmod 700 $SCRATCH_MNT/nosuid
+chmod 4755 $SCRATCH_MNT/ls
+
+su - $qa_user -c "$SCRATCH_MNT/ls $SCRATCH_MNT/nosuid >/dev/null 2>&1"
+if [ $? -eq 0 ] ; then
+ echo "Error: we shouldn't be able to ls the directory"
+fi
+umount $SCRATCH_DEV
+
+status=0
+exit
--- /dev/null
+QA output created by 128
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 129
+#
+# looptests created from CXFSQA test looptest
+#
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=allanr@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+echo_and_run()
+{
+ echo "$1"
+ $1
+}
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux
+
+_setup_testdir
+_require_scratch
+_require_user
+
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount "-o nosuid"
+
+mkdir $SCRATCH_MNT/looptest
+
+src/looptest -i 100000 -r -w -b 8192 -s $SCRATCH_MNT/looptest/looptest1.tst
+src/looptest -i 10000 -t -r -w -s -b 102400 $SCRATCH_MNT/looptest/looptest2.tst
+src/looptest -i 50000 -r -w -b 256 -s $SCRATCH_MNT/looptest/looptest3.tst
+src/looptest -i 2000 -o -r -w -b 8192 -s $SCRATCH_MNT/looptest/looptest4.tst
+
+status=0
+exit
--- /dev/null
+QA output created by 129
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 130
+#
+# xfs_io vector read/write and trunc tests. modified from cxfsqa tests
+# - unixfile_basic_block_hole
+# - unixfile_buffer_direct_coherency
+# - unixfile_direct_rw
+# - unixfile_eof_direct
+# - unixfile_fsb_edge
+# - unixfile_open_append
+# - unixfile_open_trunc
+# - unixfile_small_vector_async_rw
+# - unixfile_small_vector_sync_rw
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=allanr@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+common_line_filter()
+{
+ perl -ne 'if (/.*:(.*)/) {
+ if ( "$last_line" ne "$1" ) { print $_; $first_match=1; }
+ elsif ( $first_match==1 ) { print "*\n"; $first_match=0; }
+ $last_line="$1";
+ }
+ else {
+ print $_
+ }'
+}
+
+_filter_xfs_io()
+{
+ common_line_filter | sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([0-9/.]* [GMKiBbytes]*\/sec and [0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
+}
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux IRIX
+
+_setup_testdir
+_require_scratch
+_require_user
+
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+
+echo "End-of-file zeroing with direct I/O"
+xfs_io -f -d -t -c "pwrite -S 0x63 0 65536" \
+ -c "truncate 1" \
+ -c "pwrite -S 0x41 65536 65536" \
+ -c "pread -v 0 131072" \
+ $SCRATCH_MNT/eof-zeroing_direct | _filter_xfs_io
+
+echo
+echo "Basic Block Hole test"
+xfs_io -f -t -c "truncate 8192" \
+ -c "pread -v 5000 3000" \
+ $SCRATCH_MNT/blackhole | _filter_xfs_io
+
+echo
+echo "Test buffered and direct IO coherency"
+xfs_io -f -t -c "pwrite -S 0x41 8000 1000" \
+ -c "pwrite -S 0x57 4000 1000" \
+ $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io
+
+xfs_io -d -c "pwrite -S 0x78 20480 4096"\
+ -c "pwrite -S 0x79 4096 4096"\
+ $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io
+
+xfs_io -c "pread -v 0 9000"\
+ $SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io
+
+echo
+echo "Test direct read and write"
+xfs_io -f -d -t -c "pwrite -S 0x78 0 65536"\
+ -c "pread -v 0 65536"\
+ -c "pwrite -S 0x46 65536 6553600"\
+ -c "pread -v 0 6619136"\
+ $SCRATCH_MNT/direct_io | _filter_xfs_io
+
+xfs_io -d -c "pread -v 0 6619136"\
+ $SCRATCH_MNT/direct_io | _filter_xfs_io
+
+xfs_io -f -d -t -c "pwrite -S 0x61 0 65536"\
+ -c "pread -v 0 65536"\
+ -c "pwrite -S 0x62 65536 131072"\
+ -c "pread -v 0 131072"\
+ $SCRATCH_MNT/async_direct_io | _filter_xfs_io
+
+xfs_io -d -c "pread -v 0 131072"\
+ $SCRATCH_MNT/async_direct_io | _filter_xfs_io
+
+echo
+echo "FSB Edge test"
+xfs_io -f -t -c "truncate 131072"\
+ -c "pwrite -S 0x5F 0 131072"\
+ -c "truncate 0"\
+ -c "truncate 131072"\
+ -c "pwrite -S 0x61 65535 2"\
+ -c "pread -v 0 131072"\
+ $SCRATCH_MNT/fsb_edge_test | _filter_xfs_io
+
+echo
+echo "Open Trunk test (O_TRUNC)"
+for n in 0 1 2 3 4
+do
+ xfs_io -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io
+
+ echo "Test" > $SCRATCH_MNT/$n
+ xfs_io -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io
+ cat $SCRATCH_MNT/$n
+done
+echo "DONE"
+
+echo
+echo "Append test"
+echo "append to me" > $SCRATCH_MNT/append
+xfs_io -a -c "pwrite -S 0x61 0 10" \
+ -c "pread -v 0 24"\
+ $SCRATCH_MNT/append | _filter_xfs_io
+
+echo
+echo "Small Vector Async"
+echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
+xfs_io -f -c "pread -v 0 1"\
+ -c "pread -v 1 1"\
+ -c "pread -v 2 1"\
+ -c "pread -v 3 1"\
+ -c "pread -v 4 1"\
+ -c "pread -v 5 1"\
+ -c "pread -v 6 1"\
+ -c "pread -v 7 1"\
+ -c "pread -v 8 1"\
+ -c "pread -v 9 1"\
+ -c "pread -v 10 1"\
+ -c "pread -v 11 1"\
+ -c "pread -v 12 1"\
+ -c "pread -v 13 13"\
+ -c "pwrite -S 0x61 4090 1"\
+ -c "pwrite -S 0x62 4091 1"\
+ -c "pwrite -S 0x63 4092 1"\
+ -c "pwrite -S 0x64 4093 1"\
+ -c "pwrite -S 0x65 4094 1"\
+ -c "pwrite -S 0x66 4095 1"\
+ -c "pwrite -S 0x67 4096 1"\
+ -c "pwrite -S 0x68 4097 1"\
+ -c "pwrite -S 0x69 4098 1"\
+ -c "pwrite -S 0x6A 4099 1"\
+ -c "pwrite -S 0x6B 4100 1"\
+ -c "pwrite -S 0x6C 4101 1"\
+ -c "pwrite -S 0x6D 4102 1"\
+ -c "pwrite -S 0x6E 4103 1"\
+ -c "pwrite -S 0x6F 4104 1"\
+ -c "pwrite -S 0x70 4105 1"\
+ -c "pread -v 4090 4"\
+ -c "pread -v 4094 4"\
+ -c "pread -v 4098 4"\
+ -c "pread -v 4102 4"\
+ -c "pwrite -S 0x61 10000000000 1"\
+ -c "pwrite -S 0x62 10000000001 1"\
+ -c "pwrite -S 0x63 10000000002 1"\
+ -c "pwrite -S 0x64 10000000003 1"\
+ -c "pwrite -S 0x65 10000000004 1"\
+ -c "pwrite -S 0x66 10000000005 1"\
+ -c "pwrite -S 0x67 10000000006 1"\
+ -c "pwrite -S 0x68 10000000007 1"\
+ -c "pwrite -S 0x69 10000000008 1"\
+ -c "pwrite -S 0x6A 10000000009 1"\
+ -c "pwrite -S 0x6B 10000000010 1"\
+ -c "pwrite -S 0x6C 10000000011 1"\
+ -c "pwrite -S 0x6D 10000000012 1"\
+ -c "pwrite -S 0x6E 10000000013 1"\
+ -c "pwrite -S 0x6F 10000000014 1"\
+ -c "pwrite -S 0x70 10000000015 1"\
+ -c "pread -v 10000000000 4"\
+ -c "pread -v 10000000004 4"\
+ -c "pread -v 10000000008 4"\
+ -c "pread -v 10000000012 4"\
+ $SCRATCH_MNT/small_vector_async | _filter_xfs_io
+
+echo
+echo "Small Vector Sync"
+echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
+xfs_io -f -s -c "pread -v 0 1"\
+ -c "pread -v 1 1"\
+ -c "pread -v 2 1"\
+ -c "pread -v 3 1"\
+ -c "pread -v 4 1"\
+ -c "pread -v 5 1"\
+ -c "pread -v 6 1"\
+ -c "pread -v 7 1"\
+ -c "pread -v 8 1"\
+ -c "pread -v 9 1"\
+ -c "pread -v 10 1"\
+ -c "pread -v 11 1"\
+ -c "pread -v 12 1"\
+ -c "pread -v 13 13"\
+ -c "pwrite -S 0x61 4090 1"\
+ -c "pwrite -S 0x62 4091 1"\
+ -c "pwrite -S 0x63 4092 1"\
+ -c "pwrite -S 0x64 4093 1"\
+ -c "pwrite -S 0x65 4094 1"\
+ -c "pwrite -S 0x66 4095 1"\
+ -c "pwrite -S 0x67 4096 1"\
+ -c "pwrite -S 0x68 4097 1"\
+ -c "pwrite -S 0x69 4098 1"\
+ -c "pwrite -S 0x6A 4099 1"\
+ -c "pwrite -S 0x6B 4100 1"\
+ -c "pwrite -S 0x6C 4101 1"\
+ -c "pwrite -S 0x6D 4102 1"\
+ -c "pwrite -S 0x6E 4103 1"\
+ -c "pwrite -S 0x6F 4104 1"\
+ -c "pwrite -S 0x70 4105 1"\
+ -c "pread -v 4090 4"\
+ -c "pread -v 4094 4"\
+ -c "pread -v 4098 4"\
+ -c "pread -v 4102 4"\
+ -c "pwrite -S 0x61 10000000000 1"\
+ -c "pwrite -S 0x62 10000000001 1"\
+ -c "pwrite -S 0x63 10000000002 1"\
+ -c "pwrite -S 0x64 10000000003 1"\
+ -c "pwrite -S 0x65 10000000004 1"\
+ -c "pwrite -S 0x66 10000000005 1"\
+ -c "pwrite -S 0x67 10000000006 1"\
+ -c "pwrite -S 0x68 10000000007 1"\
+ -c "pwrite -S 0x69 10000000008 1"\
+ -c "pwrite -S 0x6A 10000000009 1"\
+ -c "pwrite -S 0x6B 10000000010 1"\
+ -c "pwrite -S 0x6C 10000000011 1"\
+ -c "pwrite -S 0x6D 10000000012 1"\
+ -c "pwrite -S 0x6E 10000000013 1"\
+ -c "pwrite -S 0x6F 10000000014 1"\
+ -c "pwrite -S 0x70 10000000015 1"\
+ -c "pread -v 10000000000 4"\
+ -c "pread -v 10000000004 4"\
+ -c "pread -v 10000000008 4"\
+ -c "pread -v 10000000012 4"\
+ $SCRATCH_MNT/small_vector_async | _filter_xfs_io
+
+status=0
+exit
--- /dev/null
+QA output created by 130
+End-of-file zeroing with direct I/O
+wrote 65536/65536 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 65536/65536 bytes at offset 65536
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c...............
+00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+*
+00010000: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
+*
+read 131072/131072 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+Basic Block Hole test
+00001388: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+*
+00001f38: 00 00 00 00 00 00 00 00 ........
+read 3000/3000 bytes at offset 5000
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+Test buffered and direct IO coherency
+wrote 1000/1000 bytes at offset 8000
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1000/1000 bytes at offset 4000
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 4096/4096 bytes at offset 20480
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 4096/4096 bytes at offset 4096
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+*
+00000fa0: 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 WWWWWWWWWWWWWWWW
+*
+00001000: 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 yyyyyyyyyyyyyyyy
+*
+00002000: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAAA
+*
+00002320: 41 41 41 41 41 41 41 41 AAAAAAAA
+read 9000/9000 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+Test direct read and write
+wrote 65536/65536 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
+*
+read 65536/65536 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 6553600/6553600 bytes at offset 65536
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
+*
+00010000: 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 FFFFFFFFFFFFFFFF
+*
+read 6619136/6619136 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 78 xxxxxxxxxxxxxxxx
+*
+00010000: 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 FFFFFFFFFFFFFFFF
+*
+read 6619136/6619136 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 65536/65536 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 aaaaaaaaaaaaaaaa
+*
+read 65536/65536 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 131072/131072 bytes at offset 65536
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00010000: 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 bbbbbbbbbbbbbbbb
+*
+read 131072/131072 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 aaaaaaaaaaaaaaaa
+*
+00010000: 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 bbbbbbbbbbbbbbbb
+*
+read 131072/131072 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+FSB Edge test
+wrote 131072/131072 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 2/2 bytes at offset 65535
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+*
+0000fff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61 ...............a
+00010000: 61 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a...............
+00010010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+*
+read 131072/131072 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+Open Trunk test (O_TRUNC)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 0/100 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+DONE
+
+Append test
+wrote 10/10 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 61 70 70 65 6e 64 20 74 6f 20 6d 65 0a 61 61 61 append.to.me.aaa
+00000010: 61 61 61 61 61 61 61 aaaaaaa
+read 23/24 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+Small Vector Async
+00000000: 61 a
+read 1/1 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000001: 62 b
+read 1/1 bytes at offset 1
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000002: 63 c
+read 1/1 bytes at offset 2
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000003: 64 d
+read 1/1 bytes at offset 3
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000004: 65 e
+read 1/1 bytes at offset 4
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000005: 66 f
+read 1/1 bytes at offset 5
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000006: 67 g
+read 1/1 bytes at offset 6
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000007: 68 h
+read 1/1 bytes at offset 7
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000008: 69 i
+read 1/1 bytes at offset 8
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000009: 6a j
+read 1/1 bytes at offset 9
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000000a: 6b k
+read 1/1 bytes at offset 10
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000000b: 6c l
+read 1/1 bytes at offset 11
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000000c: 6d m
+read 1/1 bytes at offset 12
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000000d: 6e 6f 70 71 72 73 74 75 76 77 78 79 7a nopqrstuvwxyz
+read 13/13 bytes at offset 13
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4090
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4091
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4092
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4093
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4094
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4095
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4096
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4097
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4098
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4099
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4100
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4101
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4102
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4103
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4104
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4105
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000ffa: 61 62 63 64 abcd
+read 4/4 bytes at offset 4090
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000ffe: 65 66 67 68 efgh
+read 4/4 bytes at offset 4094
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001002: 69 6a 6b 6c ijkl
+read 4/4 bytes at offset 4098
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001006: 6d 6e 6f 70 mnop
+read 4/4 bytes at offset 4102
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000000
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000001
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000002
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000003
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000004
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000005
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000006
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000007
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000008
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000009
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000010
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000011
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000012
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000013
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000014
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000015
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+2540be400: 61 62 63 64 abcd
+read 4/4 bytes at offset 10000000000
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+2540be404: 65 66 67 68 efgh
+read 4/4 bytes at offset 10000000004
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+2540be408: 69 6a 6b 6c ijkl
+read 4/4 bytes at offset 10000000008
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+2540be40c: 6d 6e 6f 70 mnop
+read 4/4 bytes at offset 10000000012
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+
+Small Vector Sync
+00000000: 61 a
+read 1/1 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000001: 62 b
+read 1/1 bytes at offset 1
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000002: 63 c
+read 1/1 bytes at offset 2
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000003: 64 d
+read 1/1 bytes at offset 3
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000004: 65 e
+read 1/1 bytes at offset 4
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000005: 66 f
+read 1/1 bytes at offset 5
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000006: 67 g
+read 1/1 bytes at offset 6
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000007: 68 h
+read 1/1 bytes at offset 7
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000008: 69 i
+read 1/1 bytes at offset 8
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000009: 6a j
+read 1/1 bytes at offset 9
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000000a: 6b k
+read 1/1 bytes at offset 10
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000000b: 6c l
+read 1/1 bytes at offset 11
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000000c: 6d m
+read 1/1 bytes at offset 12
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000000d: 6e 6f 70 71 72 73 74 75 76 77 78 79 7a nopqrstuvwxyz
+read 13/13 bytes at offset 13
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4090
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4091
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4092
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4093
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4094
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4095
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4096
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4097
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4098
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4099
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4100
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4101
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4102
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4103
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4104
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 4105
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000ffa: 61 62 63 64 abcd
+read 4/4 bytes at offset 4090
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000ffe: 65 66 67 68 efgh
+read 4/4 bytes at offset 4094
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001002: 69 6a 6b 6c ijkl
+read 4/4 bytes at offset 4098
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001006: 6d 6e 6f 70 mnop
+read 4/4 bytes at offset 4102
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000000
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000001
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000002
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000003
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000004
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000005
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000006
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000007
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000008
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000009
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000010
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000011
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000012
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000013
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000014
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1/1 bytes at offset 10000000015
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+2540be400: 61 62 63 64 abcd
+read 4/4 bytes at offset 10000000000
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+2540be404: 65 66 67 68 efgh
+read 4/4 bytes at offset 10000000004
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+2540be408: 69 6a 6b 6c ijkl
+read 4/4 bytes at offset 10000000008
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+2540be40c: 6d 6e 6f 70 mnop
+read 4/4 bytes at offset 10000000012
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 131
+#
+# lock test created from CXFSQA test lockfile_simple
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=allanr@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux
+
+_require_user
+_setup_testdir
+
+TESTFILE=$testdir/lock_file
+
+# Grab a port which is hopefully unused
+if [ $$ -gt 1024 -a $$ -lt 32000 ]; then
+ PORT=$$
+elif [ $$ -lt 1024 ]; then
+ PORT=$(($$+1024))
+elif [ $$ -gt 32000 ]; then
+ PORT=$(($$%30000+1024))
+fi
+
+# Start the server
+src/locktest -p $PORT $TESTFILE > $testdir/server.out 2>&1 &
+
+sleep 1
+
+# Start the client
+src/locktest -p $PORT -h localhost $TESTFILE > $testdir/client.out 2>&1
+result=$?
+if [ $result -eq 0 ]; then
+ echo success!
+else
+ echo "Client reported failure ($result)"
+ cat $testdir/*.out
+ _cleanup
+ exit $status
+fi
+
+status=0
+exit
--- /dev/null
+QA output created by 131
+success!
--- /dev/null
+#! /bin/sh
+# FSQA Test No. 132
+#
+# xfs_io aligned vector rw created from CXFSQA test
+# unixfile_vector_aligned_rw
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
+owner=allanr@sgi.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+common_line_filter()
+{
+ perl -ne 'if (/.*:(.*)/) {
+ if ( "$last_line" ne "$1" ) { print $_; $first_match=1; }
+ elsif ( $first_match==1 ) { print "*\n"; $first_match=0; }
+ $last_line="$1";
+ }
+ else {
+ print $_
+ }'
+}
+
+_filter_xfs_io()
+{
+ common_line_filter | sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([0-9/.]* [GMKiBbytes]*\/sec and [0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
+}
+
+# real QA test starts here
+_supported_fs xfs udf nfs
+_supported_os Linux IRIX
+
+_setup_testdir
+_require_scratch
+_require_user
+
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+
+xfs_io -f -t -c "pwrite -S 0x63 0 512" \
+ -c "pwrite -S 0x64 512 512" \
+ -c "pwrite -S 0x65 1024 512" \
+ -c "pwrite -S 0x66 1536 512" \
+ -c "pwrite -S 0x67 2048 512" \
+ -c "pwrite -S 0x68 2560 512" \
+ -c "pwrite -S 0x69 3072 512" \
+ -c "pwrite -S 0x6A 3584 512" \
+ -c "pread -v 0 512" \
+ -c "pread -v 512 512" \
+ -c "pread -v 1024 512" \
+ -c "pread -v 1536 512" \
+ -c "pread -v 2048 512" \
+ -c "pread -v 2560 512" \
+ -c "pread -v 3072 512" \
+ -c "pread -v 3584 512" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x63 4096 1024" \
+ -c "pwrite -S 0x6B 5120 1024" \
+ -c "pwrite -S 0x6C 6144 1024" \
+ -c "pwrite -S 0x6D 7168 1024" \
+ -c "pread -v 0 1024" \
+ -c "pread -v 1024 1024" \
+ -c "pread -v 2048 1024" \
+ -c "pread -v 3072 1024" \
+ -c "pread -v 4096 1024" \
+ -c "pread -v 5120 1024" \
+ -c "pread -v 6144 1024" \
+ -c "pread -v 7168 1024" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x6E 8192 2048" \
+ -c "pwrite -S 0x6F 10240 2048" \
+ -c "pread -v 0 2048" \
+ -c "pread -v 2048 2048" \
+ -c "pread -v 4096 2048" \
+ -c "pread -v 6144 2048" \
+ -c "pread -v 8192 2048" \
+ -c "pread -v 10240 2048" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x70 12288 4096" \
+ -c "pread -v 0 4096" \
+ -c "pread -v 4096 4096" \
+ -c "pread -v 8192 4096" \
+ -c "pread -v 12288 4096" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x71 16384 8192" \
+ -c "pwrite -S 0x72 24576 8192" \
+ -c "pread -v 0 8192" \
+ -c "pread -v 8192 8192" \
+ -c "pread -v 8192 8192" \
+ -c "pread -v 16384 8192" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x73 32768 16384" \
+ -c "pwrite -S 0x74 49152 16384" \
+ -c "pread -v 0 16384" \
+ -c "pread -v 16384 16384" \
+ -c "pread -v 32768 16384" \
+ -c "pread -v 49152 16384" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x75 65536 32768" \
+ -c "pwrite -S 0x76 98304 32768" \
+ -c "pread -v 0 32768" \
+ -c "pread -v 32768 32768" \
+ -c "pread -v 65536 32768" \
+ -c "pread -v 98304 32768" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x76 131072 65536" \
+ -c "pwrite -S 0x77 196608 65536" \
+ -c "pread -v 0 65536" \
+ -c "pread -v 65536 65536" \
+ -c "pread -v 131072 65536" \
+ -c "pread -v 196608 65536" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x76 262144 131072" \
+ -c "pwrite -S 0x77 393216 131072" \
+ -c "pread -v 0 131072" \
+ -c "pread -v 131072 131072" \
+ -c "pread -v 262144 131072" \
+ -c "pread -v 393216 131072" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x76 524288 524288" \
+ -c "pwrite -S 0x77 1048576 524288" \
+ -c "pread -v 0 524288" \
+ -c "pread -v 524288 524288" \
+ -c "pread -v 1048576 524288" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x32 1048576 1048576" \
+ -c "pwrite -S 0x33 2097152 1048576" \
+ -c "pwrite -S 0x34 3145728 1048576" \
+ -c "pwrite -S 0x35 4194304 1048576" \
+ -c "pwrite -S 0x36 5242880 1048576" \
+ -c "pwrite -S 0x37 6291456 1048576" \
+ -c "pwrite -S 0x38 7340032 1048576" \
+ -c "pwrite -S 0x39 8388608 1048576" \
+ -c "pread -v 0 1048576" \
+ -c "pread -v 1048576 1048576" \
+ -c "pread -v 2097152 1048576" \
+ -c "pread -v 3145728 1048576" \
+ -c "pread -v 4194304 1048576" \
+ -c "pread -v 5242880 1048576" \
+ -c "pread -v 6291456 1048576" \
+ -c "pread -v 7340032 1048576" \
+ -c "pread -v 8388608 1048576" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x32 1048576 1048576" \
+ -c "pwrite -S 0x33 2097152 1048576" \
+ -c "pwrite -S 0x34 3145728 1048576" \
+ -c "pwrite -S 0x35 4194304 1048576" \
+ -c "pwrite -S 0x36 5242880 1048576" \
+ -c "pwrite -S 0x37 6291456 1048576" \
+ -c "pwrite -S 0x38 7340032 1048576" \
+ -c "pwrite -S 0x39 8388608 1048576" \
+ -c "pwrite -S 0x3A 9437184 1048576" \
+ -c "pread -v 0 1048576" \
+ -c "pread -v 1048576 1048576" \
+ -c "pread -v 2097152 1048576" \
+ -c "pread -v 3145728 1048576" \
+ -c "pread -v 4194304 1048576" \
+ -c "pread -v 5242880 1048576" \
+ -c "pread -v 6291456 1048576" \
+ -c "pread -v 7340032 1048576" \
+ -c "pread -v 8388608 1048576" \
+ -c "pread -v 9437184 1048576" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+xfs_io -f -c "pwrite -S 0x92 10485760 10485760" \
+ -c "pwrite -S 0x93 20971520 10485760" \
+ -c "pwrite -S 0x94 31457280 10485760" \
+ -c "pwrite -S 0x95 41943040 10485760" \
+ -c "pwrite -S 0x96 52428800 10485760" \
+ -c "pwrite -S 0x97 62914560 10485760" \
+ -c "pwrite -S 0x98 73400320 10485760" \
+ -c "pwrite -S 0x99 83886080 10485760" \
+ -c "pwrite -S 0x9A 94371840 10485760" \
+ -c "pread -v 0 10485760" \
+ -c "pread -v 10485760 10485760" \
+ -c "pread -v 20971520 10485760" \
+ -c "pread -v 31457280 10485760" \
+ -c "pread -v 41943040 10485760" \
+ -c "pread -v 52428800 10485760" \
+ -c "pread -v 62914560 10485760" \
+ -c "pread -v 73400320 10485760" \
+ -c "pread -v 83886080 10485760" \
+ -c "pread -v 94371840 10485760" \
+ $SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io
+
+status=0
+exit
--- /dev/null
+QA output created by 132
+wrote 512/512 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 512
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 1024
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 1536
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 2048
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 2560
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 3072
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 512/512 bytes at offset 3584
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+read 512/512 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+read 512/512 bytes at offset 512
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+read 512/512 bytes at offset 1024
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+read 512/512 bytes at offset 1536
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+read 512/512 bytes at offset 2048
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+read 512/512 bytes at offset 2560
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+read 512/512 bytes at offset 3072
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+read 512/512 bytes at offset 3584
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1024/1024 bytes at offset 4096
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1024/1024 bytes at offset 5120
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1024/1024 bytes at offset 6144
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1024/1024 bytes at offset 7168
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+read 1024/1024 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+read 1024/1024 bytes at offset 1024
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+read 1024/1024 bytes at offset 2048
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+read 1024/1024 bytes at offset 3072
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+read 1024/1024 bytes at offset 4096
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+read 1024/1024 bytes at offset 5120
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+read 1024/1024 bytes at offset 6144
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+read 1024/1024 bytes at offset 7168
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 2048/2048 bytes at offset 8192
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 2048/2048 bytes at offset 10240
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+read 2048/2048 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+read 2048/2048 bytes at offset 2048
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+read 2048/2048 bytes at offset 4096
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+read 2048/2048 bytes at offset 6144
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+read 2048/2048 bytes at offset 8192
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+read 2048/2048 bytes at offset 10240
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 4096/4096 bytes at offset 12288
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+read 4096/4096 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+read 4096/4096 bytes at offset 4096
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+read 4096/4096 bytes at offset 8192
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+read 4096/4096 bytes at offset 12288
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 8192/8192 bytes at offset 16384
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 8192/8192 bytes at offset 24576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+read 8192/8192 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+read 8192/8192 bytes at offset 8192
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+read 8192/8192 bytes at offset 8192
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+read 8192/8192 bytes at offset 16384
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 16384/16384 bytes at offset 32768
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 16384/16384 bytes at offset 49152
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+read 16384/16384 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+00006000: 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 rrrrrrrrrrrrrrrr
+*
+read 16384/16384 bytes at offset 16384
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00008000: 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 ssssssssssssssss
+*
+read 16384/16384 bytes at offset 32768
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+0000c000: 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 tttttttttttttttt
+*
+read 16384/16384 bytes at offset 49152
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 32768/32768 bytes at offset 65536
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 32768/32768 bytes at offset 98304
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+00006000: 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 rrrrrrrrrrrrrrrr
+*
+read 32768/32768 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00008000: 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 ssssssssssssssss
+*
+0000c000: 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 tttttttttttttttt
+*
+read 32768/32768 bytes at offset 32768
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00010000: 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 uuuuuuuuuuuuuuuu
+*
+read 32768/32768 bytes at offset 65536
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00018000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+read 32768/32768 bytes at offset 98304
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 65536/65536 bytes at offset 131072
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 65536/65536 bytes at offset 196608
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+00006000: 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 rrrrrrrrrrrrrrrr
+*
+00008000: 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 ssssssssssssssss
+*
+0000c000: 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 tttttttttttttttt
+*
+read 65536/65536 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00010000: 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 uuuuuuuuuuuuuuuu
+*
+00018000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+read 65536/65536 bytes at offset 65536
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+read 65536/65536 bytes at offset 131072
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00030000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+read 65536/65536 bytes at offset 196608
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 131072/131072 bytes at offset 262144
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 131072/131072 bytes at offset 393216
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+00006000: 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 rrrrrrrrrrrrrrrr
+*
+00008000: 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 ssssssssssssssss
+*
+0000c000: 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 tttttttttttttttt
+*
+00010000: 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 uuuuuuuuuuuuuuuu
+*
+00018000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+read 131072/131072 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00030000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+read 131072/131072 bytes at offset 131072
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00040000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+read 131072/131072 bytes at offset 262144
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00060000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+read 131072/131072 bytes at offset 393216
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 524288/524288 bytes at offset 524288
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 524288/524288 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+00006000: 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 rrrrrrrrrrrrrrrr
+*
+00008000: 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 ssssssssssssssss
+*
+0000c000: 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 tttttttttttttttt
+*
+00010000: 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 uuuuuuuuuuuuuuuu
+*
+00018000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00030000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+00040000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00060000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+read 524288/524288 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00080000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+read 524288/524288 bytes at offset 524288
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00100000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+read 524288/524288 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 2097152
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 3145728
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 4194304
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 5242880
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 6291456
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 7340032
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 8388608
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+00006000: 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 rrrrrrrrrrrrrrrr
+*
+00008000: 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 ssssssssssssssss
+*
+0000c000: 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 tttttttttttttttt
+*
+00010000: 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 uuuuuuuuuuuuuuuu
+*
+00018000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00030000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+00040000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00060000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+00080000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+read 1048576/1048576 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00100000: 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 2222222222222222
+*
+read 1048576/1048576 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00200000: 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 3333333333333333
+*
+read 1048576/1048576 bytes at offset 2097152
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00300000: 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 4444444444444444
+*
+read 1048576/1048576 bytes at offset 3145728
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00400000: 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 5555555555555555
+*
+read 1048576/1048576 bytes at offset 4194304
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00500000: 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 6666666666666666
+*
+read 1048576/1048576 bytes at offset 5242880
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00600000: 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 7777777777777777
+*
+read 1048576/1048576 bytes at offset 6291456
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00700000: 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 8888888888888888
+*
+read 1048576/1048576 bytes at offset 7340032
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00800000: 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 9999999999999999
+*
+read 1048576/1048576 bytes at offset 8388608
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 2097152
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 3145728
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 4194304
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 5242880
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 6291456
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 7340032
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 8388608
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 1048576/1048576 bytes at offset 9437184
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+00006000: 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 rrrrrrrrrrrrrrrr
+*
+00008000: 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 ssssssssssssssss
+*
+0000c000: 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 tttttttttttttttt
+*
+00010000: 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 uuuuuuuuuuuuuuuu
+*
+00018000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00030000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+00040000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00060000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+00080000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+read 1048576/1048576 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00100000: 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 2222222222222222
+*
+read 1048576/1048576 bytes at offset 1048576
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00200000: 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 3333333333333333
+*
+read 1048576/1048576 bytes at offset 2097152
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00300000: 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 4444444444444444
+*
+read 1048576/1048576 bytes at offset 3145728
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00400000: 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 5555555555555555
+*
+read 1048576/1048576 bytes at offset 4194304
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00500000: 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 6666666666666666
+*
+read 1048576/1048576 bytes at offset 5242880
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00600000: 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 7777777777777777
+*
+read 1048576/1048576 bytes at offset 6291456
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00700000: 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 8888888888888888
+*
+read 1048576/1048576 bytes at offset 7340032
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00800000: 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 9999999999999999
+*
+read 1048576/1048576 bytes at offset 8388608
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00900000: 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a ................
+*
+read 1048576/1048576 bytes at offset 9437184
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 10485760
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 20971520
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 31457280
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 41943040
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 52428800
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 62914560
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 73400320
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 83886080
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+wrote 10485760/10485760 bytes at offset 94371840
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00000000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00000200: 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
+*
+00000400: 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 eeeeeeeeeeeeeeee
+*
+00000600: 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 ffffffffffffffff
+*
+00000800: 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 gggggggggggggggg
+*
+00000a00: 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 68 hhhhhhhhhhhhhhhh
+*
+00000c00: 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 iiiiiiiiiiiiiiii
+*
+00000e00: 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a 6a jjjjjjjjjjjjjjjj
+*
+00001000: 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 cccccccccccccccc
+*
+00001400: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
+*
+00001800: 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c 6c llllllllllllllll
+*
+00001c00: 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d mmmmmmmmmmmmmmmm
+*
+00002000: 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e nnnnnnnnnnnnnnnn
+*
+00002800: 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f 6f oooooooooooooooo
+*
+00003000: 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 pppppppppppppppp
+*
+00004000: 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 qqqqqqqqqqqqqqqq
+*
+00006000: 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 rrrrrrrrrrrrrrrr
+*
+00008000: 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73 ssssssssssssssss
+*
+0000c000: 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 74 tttttttttttttttt
+*
+00010000: 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 uuuuuuuuuuuuuuuu
+*
+00018000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00030000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+00040000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00060000: 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 wwwwwwwwwwwwwwww
+*
+00080000: 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 76 vvvvvvvvvvvvvvvv
+*
+00100000: 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 2222222222222222
+*
+00200000: 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 3333333333333333
+*
+00300000: 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 4444444444444444
+*
+00400000: 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 5555555555555555
+*
+00500000: 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 6666666666666666
+*
+00600000: 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 7777777777777777
+*
+00700000: 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 8888888888888888
+*
+00800000: 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 9999999999999999
+*
+00900000: 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a 3a ................
+*
+read 10485760/10485760 bytes at offset 0
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+00a00000: 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 ................
+*
+read 10485760/10485760 bytes at offset 10485760
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+01400000: 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 ................
+*
+read 10485760/10485760 bytes at offset 20971520
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+01e00000: 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 ................
+*
+read 10485760/10485760 bytes at offset 31457280
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+02800000: 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 ................
+*
+read 10485760/10485760 bytes at offset 41943040
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+03200000: 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ................
+*
+read 10485760/10485760 bytes at offset 52428800
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+03c00000: 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 97 ................
+*
+read 10485760/10485760 bytes at offset 62914560
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+04600000: 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 98 ................
+*
+read 10485760/10485760 bytes at offset 73400320
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+05000000: 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 ................
+*
+read 10485760/10485760 bytes at offset 83886080
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+05a00000: 9a 9a 9a 9a 9a 9a 9a 9a 9a 9a 9a 9a 9a 9a 9a 9a ................
+*
+read 10485760/10485760 bytes at offset 94371840
+XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
_notrun "External device testing in progress, skipped this test"
}
+# check for the fsgqa user on the machine
+#
+_require_user()
+{
+ qa_user=fsgqa
+ cat /etc/passwd | grep -q $qa_user
+ [ "$?" == "0" ] || _notrun "$qa_user user not defined."
+}
+
# check that a FS is mounted as XFS. if so, return mount point
#
_xfs_mounted()
# AIO operations
aio nathans@sgi.com
+# Pattern writing and checking
+pattern ajones@sgi.com
+
# test-group association ... one line per test
#
001 rw dir udf auto
120 other auto
121 log auto
122 other auto
+123 perms auto
+124 pattern auto
+125 other auto
+126 perms auto
+127 rw auto
+128 perms auto
+129 rw auto
+130 pattern auto
+131 perms auto
+132 pattern auto
\ No newline at end of file
int closeprob = 0; /* -c flag */
int debug = 0; /* -d flag */
unsigned long debugstart = 0; /* -D flag */
-int do_fsync = 0; /* -f flag */
+int flush = 0; /* -f flag */
+int do_fsync = 0; /* -y flag */
unsigned long maxfilelen = 256 * 1024; /* -l flag */
int sizechecks = 1; /* -n flag disables them */
int maxoplen = 64 * 1024; /* -o flag */
int o_direct; /* -Z */
int aio = 0;
+int page_size;
+int page_mask;
+int mmap_mask;
#ifdef AIO
int aio_rw(int rw, int fd, char *buf, unsigned len, unsigned offset);
#define READ 0
ftruncate(fd, 0);
}
+void
+doflush(unsigned offset, unsigned size)
+{
+ unsigned pg_offset;
+ unsigned map_size;
+ char *p;
+
+ if (o_direct == O_DIRECT)
+ return;
+
+ pg_offset = offset & mmap_mask;
+ map_size = pg_offset + size;
+
+ if ((p = (char *)mmap(0, map_size, PROT_READ | PROT_WRITE,
+ MAP_FILE | MAP_SHARED, fd,
+ (off_t)(offset - pg_offset))) == (char *)-1) {
+ prterr("doflush: mmap");
+ report_failure(202);
+ }
+ if (msync(p, map_size, MS_INVALIDATE) != 0) {
+ prterr("doflush: msync");
+ report_failure(203);
+ }
+ if (munmap(p, map_size) != 0) {
+ prterr("doflush: munmap");
+ report_failure(204);
+ }
+}
void
doread(unsigned offset, unsigned size)
report_failure(152);
}
}
+ if (flush) {
+ doflush(offset, size);
+ }
}
-b opnum: beginning operation number (default 1)\n\
-c P: 1 in P chance of file close+open at each op (default infinity)\n\
-d: debug output for all operations\n\
+ -f flush and invalidate cache after I/O\n\
-l flen: the upper bound on file size (default 262144)\n\
-m startop:endop: monitor (print debug output) specified byte range (default 0:infinity)\n\
-n: no verifications of file size\n\
-s style: 1 gives smaller truncates (default 0)\n\
-t truncbdy: 4096 would make truncates page aligned (default 1)\n\
-w writebdy: 4096 would make writes page aligned (default 1)\n\
- -x: preallocate file space before starting, XFS only (default 0)\n"
+ -x: preallocate file space before starting, XFS only (default 0)\n\
+ -y synchronize changes to a file\n"
+
#ifdef AIO
- "-A: Use the AIO system calls\n"
+" -A: Use the AIO system calls\n"
#endif
- "-D startingop: debug output starting at specified operation\n\
+" -D startingop: debug output starting at specified operation\n\
-L: fsxLite - no file creations & no file size changes\n\
-N numops: total # operations to do (default infinity)\n\
-O: use oplen (see -o flag) for every op (default random)\n\
goodfile[0] = 0;
logfile[0] = 0;
+ page_size = getpagesize();
+ page_mask = page_size - 1;
+ mmap_mask = page_mask;
+
+
setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */
- while ((ch = getopt(argc, argv, "b:c:dl:m:no:p:qr:s:t:w:xAD:LN:OP:RS:WZ"))
+ while ((ch = getopt(argc, argv, "b:c:dfl:m:no:p:qr:s:t:w:xyAD:LN:OP:RS:WZ"))
!= EOF)
switch (ch) {
case 'b':
debug = 1;
break;
case 'f':
- do_fsync = 1;
+ flush = 1;
break;
case 'l':
maxfilelen = getnum(optarg, &endp);
case 'x':
prealloc = 1;
break;
+ case 'y':
+ do_fsync = 1;
+ break;
case 'A':
aio = 1;
break;
godown resvtest writemod makeextents itrash \
multi_open_unlink dmiperf
-LINUX_TARGETS = loggen xfsctl bstat t_mtab getdevicesize
+LINUX_TARGETS = loggen xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
+ preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest locktest
IRIX_TARGETS = open_unlink
dmiperf: dmiperf.o $(LIBATTR)
$(LINKTEST) $(LIBATTR) $(LDLIBS)
+preallo_rw_pattern_reader:
+ $(CC) -DREAD iopat.c -o preallo_rw_pattern_reader
+
+preallo_rw_pattern_writer:
+ $(CC) -DWRITE iopat.c -o preallo_rw_pattern_writer
+
+ftrunc: ftrunc.o
+ $(LINKTEST)
+
+trunc: trunc.o
+ $(LINKTEST)
+
+fs_perms: fs_perms.o
+ $(LINKTEST)
+
+testx: testx.o
+ $(LINKTEST)
+
+looptest: looptest.o
+ $(LINKTEST)
+
+locktest: locktest.o
+ $(LINKTEST)
ifeq ($(PKG_PLATFORM),irix)
fill2: fill2.o
--- /dev/null
+/*
+ *
+ * Copyright (c) International Business Machines Corp., 2000
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * FILE(s) : fs_perms.c simpletest.sh textx.o Makefile README
+ * DESCRIPTION : Regression test for Linux filesystem permissions.
+ * AUTHOR : Jeff Martin (martinjn@us.ibm.com)
+ * HISTORY :
+ * (04/12/01)v.99 First attempt at using C for fs-regression test. Only tests read and write bits.
+ * (04/19/01)v1.0 Added test for execute bit.
+ * (05/23/01)v1.1 Added command line parameter to specify test file.
+ * (07/12/01)v1.2 Removed conf file and went to command line parameters.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+int testsetup(mode_t mode, int cuserId, int cgroupId);
+int testfperm(int userId, int groupId, char* fperm);
+
+int main( int argc, char *argv[]) {
+ char fperm[1];
+ int result, exresult=0, cuserId=0, cgroupId=0, userId=0, groupId=0;
+ mode_t mode;
+
+ switch (argc) {
+ case 8:
+ mode = strtol(argv[1],(char**)NULL,010);
+ cuserId = atoi(argv[2]);
+ cgroupId = atoi(argv[3]);
+ userId = atoi(argv[4]);
+ groupId = atoi(argv[5]);
+ fperm[0] = *argv[6];
+ exresult = atoi(argv[7]);
+ break;
+ default:
+ printf("Usage: %s <mode of file> <UID of file> <GID of file> <UID of tester> <GID of tester> <permission to test r|w|x> <expected result as 0|1>\n",argv[0]);
+ exit(0);
+ }
+
+ testsetup(mode,cuserId,cgroupId);
+ result=testfperm(userId,groupId,fperm);
+ system("rm test.file");
+ printf("%c a %03o file owned by (%d/%d) as user/group(%d/%d) ",fperm[0],mode,cuserId,cgroupId,userId,groupId);
+ if (result == exresult) {
+ printf("PASS\n");
+ exit(0);
+ }
+ else {
+ printf("FAIL\n");
+ exit(1);
+ }
+}
+
+int testsetup(mode_t mode, int cuserId, int cgroupId) {
+ system("cp testx.file test.file");
+ chmod("test.file",mode);
+ chown("test.file",cuserId,cgroupId);
+ return(0);
+}
+
+int testfperm(int userId, int groupId, char* fperm) {
+
+ FILE *testfile;
+ pid_t PID;
+ int tmpi,nuthertmpi;
+
+/* SET CURRENT USER/GROUP PERMISSIONS */
+ if(setegid(groupId)) {
+ printf("could not setegid to %d.\n",groupId);
+ seteuid(0);
+ setegid(0);
+ return(-1);
+ }
+ if(seteuid(userId)) {
+ printf("could not seteuid to %d.\n",userId);
+ seteuid(0);
+ setegid(0);
+ return(-1);
+ }
+
+ switch(tolower(fperm[0])) {
+ case 'x':
+ PID = fork();
+ if (PID == 0) {
+ execlp("./test.file","test.file",NULL);
+ exit(0);
+ }
+ wait(&tmpi);
+ nuthertmpi=WEXITSTATUS(tmpi);
+ seteuid(0);
+ setegid(0);
+ return(nuthertmpi);
+
+ default:
+ if((testfile=fopen("test.file",fperm))){
+ fclose(testfile);
+ seteuid(0);
+ setegid(0);
+ return (1);
+ }
+ else {
+ seteuid(0);
+ setegid(0);
+ return (0);
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+
+int
+main(argc, argv)
+int argc;
+char **argv;
+
+{
+char ch, *filename="testfile";
+int c;
+int fd, err;
+
+if(argc != 3)
+ { printf("Usage: cxfs_ftrunc -f filename\n");
+ exit(1);
+ }
+
+while((c=getopt(argc,argv,"f:"))!=EOF) {
+ ch = (char)c;
+ switch (c) {
+ case 'f':
+ filename = optarg;
+ break;
+ default:
+ fprintf(stderr,"Usage: ftrunc -f filename\n");
+ exit(1);
+ }
+ }
+
+
+
+
+ /* open RDWR but with read-only perms */
+ fd = open(filename, O_CREAT|O_RDWR, 0400);
+ if (fd < 0) {
+ perror("open failed");
+ return 1;
+ }
+
+ err = ftruncate(fd, 1000);
+ if (err < 0) {
+ perror("ftruncate failed");
+ return 1;
+ }
+
+ err = unlink(filename);
+ if (err < 0) {
+ perror("unlink failed");
+ return 1;
+ }
+
+ return 0;
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <xfs/libxfs.h>
+struct xfs_flock64 f;
+
+int main(int argc, char **argv)
+{
+ int fd, i;
+
+ int64_t x[131072];
+
+ for (i = 0; i < 131072; i++) {
+ x[i] = -1;
+ }
+ fd = open(argv[1], O_RDWR | O_CREAT, 0644);
+
+#ifdef WRITE
+ f.l_whence = 0;
+ f.l_start = 0;
+ f.l_len = 1048576;
+ xfsctl (argv[1], fd, XFS_IOC_RESVSP, &f);
+ for (i = 0; i < 131072; i++) {
+ x[i] = i;
+ }
+ write(fd, &x, 1048576);
+#endif
+
+#ifdef READ
+ read(fd, &x, 1048576);
+ for (i = 0; i < 131072; i++) {
+ if (x[i] != i) {
+ printf("error: %d %d %d\n",i,8*i,x[i]);
+ exit(1);
+ }
+ }
+#endif
+
+ close(fd);
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * Synchronized byte range lock exerciser
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <netdb.h>
+#include <endian.h>
+#include <byteswap.h>
+#include <errno.h>
+#include <string.h>
+#define HEX_2_ASC(x) ((x) > 9) ? (x)-10+'a' : (x)+'0'
+#define FILE_SIZE 1024
+#define PLATFORM_INIT() /*no-op*/
+#define PLATFORM_CLEANUP() /*no-op*/
+#define LL "ll"
+
+#define inet_aton(STRING, INADDRP) \
+ (((INADDRP)->s_addr = inet_addr(STRING)) == -1 ? 0 : 1)
+
+/* this assumes 32 bit pointers */
+#define PTR_TO_U64(P) ((unsigned __int64)(unsigned int)(P))
+#define U64_TO_PTR(T,U) ((T)(void *)(unsigned int)(U))
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define bswap_uint16(x) (uint16_t)bswap_16(x)
+#define bswap_uint32(x) (uint32_t)bswap_32(x)
+#define bswap_uint64(x) (uint64_t)bswap_64(x)
+#else
+#define bswap_uint16(x) x
+#define bswap_uint32(x) x
+#define bswap_uint64(x) x
+#endif
+
+#define SOCKET int
+#define SOCKET_READ read
+#define SOCKET_WRITE write
+#define SOCKET_CLOSE(S) (close(S))
+#define INVALID_SOCKET -1
+
+#define O_BINARY 0
+
+#define HANDLE int
+#define INVALID_HANDLE -1
+#define OPEN(N,F) (open(N, F|O_CREAT|O_RDWR|O_BINARY| \
+ (D_flag ? O_DIRECT : 0), 0644))
+#define SEEK(H, O) (lseek(H, O, SEEK_SET))
+#define READ(H, B, L) (read(H, B, L))
+#define WRITE(H, B, L) (write(H, B, L))
+#define CLOSE(H) (close(H))
+
+#define RAND() (rand())
+#define SRAND(s) (srand(s))
+#define SLEEP(s) (sleep(s))
+
+#define MIN(A,B) (((A)<(B))?(A):(B))
+#define MAX(A,B) (((A)>(B))?(A):(B))
+
+#define ALLOC_ALIGNED(S) (memalign(65536, S))
+#define FREE_ALIGNED(P) (free(P))
+
+static char *prog;
+static char *filename = 0;
+static int debug = 0;
+static int server = 1;
+static int maxio = 8192;
+static int port = 7890;
+static int reopen=0;
+static int closed=0;
+static int testnumber = -1;
+static int saved_errno = 0;
+
+static SOCKET s_fd = -1; /* listen socket */
+static SOCKET c_fd = -1; /* IPC socket */
+static HANDLE f_fd = INVALID_HANDLE; /* shared file */
+static char *buf; /* I/O buffer */
+static int D_flag = 0;
+
+#define WRLOCK 0
+#define RDLOCK 1
+#define UNLOCK 2
+#define F_CLOSE 3
+#define F_OPEN 4
+
+#define PASS 1
+#define FAIL 0
+
+#define SERVER 0
+#define CLIENT 1
+
+#define TEST_NUM 0
+#define COMMAND 1
+#define OFFSET 2
+#define LENGTH 3
+#define RESULT 4
+#define WHO 5
+#define FLAGS 2 /* index 2 is also used for do_open() flag, see below */
+
+/*
+ * flags for Mac OS X do_open()
+ * O_RDONLY 0x0000
+ * O_WRONLY 0x0001
+ * O_RDWR 0x0002
+ * O_NONBLOCK 0x0004
+ * O_APPEND 0x0008
+ * O_SHLOCK 0x0010
+ * O_EXLOCK 0x0020
+ * O_ASYNC 0x0040
+ * O_FSYNC 0x0080
+ * O_NOFOLLOW 0x0100
+ * O_CREAT 0x0200
+ * O_TRUNC 0x0400
+ * O_EXCL 0x0800
+ */
+
+/*
+ * When adding tests be sure to add to both the descriptions AND tests array.
+ * Also, be sure to undo whatever is set for each test (eg unlock any locks)
+ * There is no need to have a matching client command for each server command
+ * (or vice versa)
+ */
+
+char *descriptions[] = {
+ /* 1 */"Add a lock to an empty lock list",
+ /* 2 */"Add a lock to the start and end of a list - no overlaps",
+ /* 3 */"Add a lock to the middle of a list - no overlap",
+ /* 4 */"Add different lock types to middle of the list - overlap exact match",
+ /* 5 */"Add new lock which completely overlaps any old lock in the list",
+ /* 6 */"Add new lock which itself is completely overlaped by any old lock in the list",
+ /* 7 */"Add new lock which starts before any old lock in the list",
+ /* 8 */"Add new lock which starts in the middle of any old lock in the list and ends after",
+ /* 9 */"Add different new lock types which completely overlaps any old lock in the list",
+ /* 10 */"Add different new locks which are completely overlaped by an old lock in the list",
+ /* 11 */"Add different new lock types which start before the old lock in the list",
+ /* 12 */"Add different new lock types which start in the middle of an old lock in the list and end after",
+ /* 13 */"Add new lock, differing types and processes, to middle of the list - exact overlap match",
+ /* 14 */"Add new lock, differing types and processes, which completely overlap any of the locks in the list",
+ /* 15 */"Add new lock, differing types and processes, which are completely overlaped by locks in the list",
+ /* 16 */"Add new lock, differing types and processes, which start before a lock in the list",
+ /* 17 */"Add new lock, differing types and processes, which starts in the middle of a lock, and ends after",
+ /* 18 */"Acquire write locks with overlapping ranges",
+ /* 19 */"Acquire write locks with non-overlapping ranges extending beyond EOF",
+ /* 20 */"Acquire write locks with overlapping ranges extending beyond EOF",
+ /* 21 */"Acquire write locks on whole files",
+ /* 22 */"Acquire write lock on whole file and range write lock",
+ /* 23 */"Acquire read locks with non-overlapping ranges",
+ /* 24 */"Acquire read locks with overlapping ranges",
+ /* 25 */"Acquire read and write locks with no overlapping ranges",
+ /* 26 */"Acquire read and write locks with overlapping ranges",
+ /* 27 */"Acquire whole file write lock and then close without unlocking (and attempt a lock)",
+ /* 28 */"Acquire two read locks, close and reopen the file, and test if the inital lock is still there",
+ #if defined(macosx)
+ /* 29 */"Close the opened file and open the file with SHLOCK, other client will try to open with SHLOCK too",
+ /* 30 */"Close the opened file and open the file with SHLOCK, other client will try to open with EXLOCK",
+ /* 31 */"Close the opened file and open the file with EXLOCK, other client will try to open with EXLOCK too"
+ #endif
+};
+
+static int64_t tests[][6] =
+ /* test # Action offset length expected server/client */
+ {
+ /* Various simple tests exercising the list */
+
+/* SECTION 1: WRITE and UNLOCK with the same process (SERVER) */
+ /* Add a lock to an empty list */
+ {1, WRLOCK, 1, 10, PASS, SERVER },
+ {1, UNLOCK, 1, 10, PASS, SERVER },
+
+ /* Add a lock to the start and end of a list - 1, 13 - no overlap */
+ {2, WRLOCK, 10, 10, PASS, SERVER },
+ {2, WRLOCK, 30, 10, PASS, SERVER },
+ {2, WRLOCK, 50, 10, PASS, SERVER },
+ {2, WRLOCK, 1, 5, PASS, SERVER },
+ {2, WRLOCK, 70, 5, PASS, SERVER },
+
+ {2, UNLOCK, 10, 10, PASS, SERVER },
+ {2, UNLOCK, 30, 10, PASS, SERVER },
+ {2, UNLOCK, 50, 10, PASS, SERVER },
+ {2, UNLOCK, 1, 5, PASS, SERVER },
+ {2, UNLOCK, 70, 5, PASS, SERVER },
+
+ /* Add a lock to the middle of a list - no overlap */
+ {3, WRLOCK, 10, 10, PASS, SERVER },
+ {3, WRLOCK, 30, 10, PASS, SERVER },
+ {3, WRLOCK, 50, 10, PASS, SERVER },
+ {3, WRLOCK, 42, 5, PASS, SERVER },
+
+ {3, UNLOCK, 10, 10, PASS, SERVER },
+ {3, UNLOCK, 30, 10, PASS, SERVER },
+ {3, UNLOCK, 50, 10, PASS, SERVER },
+ {3, UNLOCK, 42, 5, PASS, SERVER },
+
+ /* Add different lock types to middle of the list - overlap exact match - 3 */
+ {4, WRLOCK, 10, 10, PASS, SERVER },
+ {4, WRLOCK, 30, 10, PASS, SERVER },
+ {4, WRLOCK, 50, 10, PASS, SERVER },
+ /* Exact match - same lock type */
+ {4, WRLOCK, 30, 10, PASS, SERVER },
+ /* Exact match - different lock type */
+ {4, RDLOCK, 30, 10, PASS, SERVER },
+ /* Exact match - unlock */
+ {4, UNLOCK, 30, 10, PASS, SERVER },
+ /* New lock - as above, inserting in the list again */
+ {4, WRLOCK, 30, 10, PASS, SERVER },
+
+ {4, UNLOCK, 10, 10, PASS, SERVER },
+ {4, UNLOCK, 30, 10, PASS, SERVER },
+ {4, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add new lock which completely overlaps any old lock in the list - 4,5,6 */
+ {5, WRLOCK, 10, 10, PASS, SERVER },
+ {5, WRLOCK, 30, 10, PASS, SERVER },
+ {5, WRLOCK, 50, 10, PASS, SERVER },
+ /* The start is the same, end overlaps */
+ {5, WRLOCK, 30, 15, PASS, SERVER },
+ /* The start is before, end is the same */
+ {5, WRLOCK, 25, 20, PASS, SERVER },
+ /* Both start and end overlap */
+ {5, WRLOCK, 22, 26, PASS, SERVER },
+
+ {5, UNLOCK, 10, 10, PASS, SERVER },
+ {5, UNLOCK, 22, 26, PASS, SERVER },
+ {5, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add new lock which itself is completely overlaped by any old lock in the list - 7,8,10 */
+ {6, WRLOCK, 10, 10, PASS, SERVER },
+ {6, WRLOCK, 30, 10, PASS, SERVER },
+ {6, WRLOCK, 50, 10, PASS, SERVER },
+ /* The start is the same, end is in the middle of old lock - NOP */
+ {6, WRLOCK, 30, 5, PASS, SERVER },
+ /* The start and end are in the middle of old lock - NOP */
+ {6, WRLOCK, 32, 6, PASS, SERVER },
+ /* Start in the middle and end is the same - NOP */
+ {6, WRLOCK, 32, 8, PASS, SERVER },
+
+ {6, UNLOCK, 10, 10, PASS, SERVER },
+ {6, UNLOCK, 30, 10, PASS, SERVER },
+ {6, UNLOCK, 32, 8, PASS, SERVER },
+ {6, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add new lock which starts before any old lock in the list - 2,9 */
+ {7, WRLOCK, 10, 10, PASS, SERVER },
+ {7, WRLOCK, 30, 10, PASS, SERVER },
+ {7, WRLOCK, 50, 10, PASS, SERVER },
+ /* Here is the new lock */
+ {7, WRLOCK, 27, 10, PASS, SERVER },
+ /* Go again with the end of the new lock matching the start of old lock */
+ {7, WRLOCK, 25, 2, PASS, SERVER },
+
+ {7, UNLOCK, 10, 10, PASS, SERVER },
+ {7, UNLOCK, 25, 15, PASS, SERVER },
+ {7, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add new lock which starts in the middle of any old lock in the list and ends after - 11,12 */
+ {8, WRLOCK, 10, 10, PASS, SERVER },
+ {8, WRLOCK, 30, 10, PASS, SERVER },
+ {8, WRLOCK, 50, 10, PASS, SERVER },
+ /* Here is the new lock */
+ {8, WRLOCK, 35, 10, PASS, SERVER },
+ /* Go again with the end of the new lock matching the start of old lock */
+ {8, WRLOCK, 45, 2, PASS, SERVER },
+
+ {8, UNLOCK, 10, 10, PASS, SERVER },
+ {8, UNLOCK, 30, 17, PASS, SERVER },
+ {8, UNLOCK, 50, 10, PASS, SERVER },
+/* SECTION 2: Overlapping READ and WRITE and UNLOCK with the same process (SERVER) */
+ /* Add different new lock types which completely overlaps any old lock in the list - 4,5,6 */
+ {9, WRLOCK, 10, 10, PASS, SERVER },
+ {9, WRLOCK, 30, 10, PASS, SERVER },
+ {9, WRLOCK, 50, 10, PASS, SERVER },
+ /* The start is the same, end overlaps */
+ {9, RDLOCK, 30, 15, PASS, SERVER },
+ /* The start is before, end is the same */
+ {9, WRLOCK, 25, 20, PASS, SERVER },
+ /* Both start and end overlap */
+ {9, RDLOCK, 22, 26, PASS, SERVER },
+
+ {9, UNLOCK, 10, 10, PASS, SERVER },
+ {9, UNLOCK, 22, 26, PASS, SERVER },
+ {9, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add different new locks which are completely overlaped by an old lock in the list - 7,8,10 */
+ {10, WRLOCK, 10, 10, PASS, SERVER },
+ {10, WRLOCK, 30, 10, PASS, SERVER },
+ {10, WRLOCK, 50, 10, PASS, SERVER },
+ /* The start is the same, end is in the middle of old lock */
+ {10, RDLOCK, 30, 5, PASS, SERVER },
+ /* The start and end are in the middle of a lock */
+ {10, WRLOCK, 32, 2, PASS, SERVER },
+ /* Start in the middle and end is the same */
+ {10, RDLOCK, 36, 5, PASS, SERVER },
+
+ {10, UNLOCK, 10, 10, PASS, SERVER },
+ {10, UNLOCK, 30, 11, PASS, SERVER },
+ {10, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add different new lock types which start before the old lock in the list - 2,9 */
+ {11, WRLOCK, 10, 10, PASS, SERVER },
+ {11, WRLOCK, 30, 10, PASS, SERVER },
+ {11, WRLOCK, 50, 10, PASS, SERVER },
+ /* Here is the new lock */
+ {11, RDLOCK, 27, 10, PASS, SERVER },
+ /* Go again with the end of the new lock matching the start of lock */
+ {11, WRLOCK, 25, 3, PASS, SERVER },
+
+ {11, UNLOCK, 10, 10, PASS, SERVER },
+ {11, UNLOCK, 25, 15, PASS, SERVER },
+ {11, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add different new lock types which start in the middle of an old lock in the list and end after - 11,12 */
+ {12, WRLOCK, 10, 10, PASS, SERVER },
+ {12, WRLOCK, 30, 10, PASS, SERVER },
+ {12, WRLOCK, 50, 10, PASS, SERVER },
+ /* Here is the new lock */
+ {12, RDLOCK, 35, 10, PASS, SERVER },
+ /* Go again with the end of the new lock matching the start of old lock */
+ {12, WRLOCK, 44, 3, PASS, SERVER },
+
+ {12, UNLOCK, 10, 10, PASS, SERVER },
+ {12, UNLOCK, 30, 18, PASS, SERVER },
+ {12, UNLOCK, 50, 10, PASS, SERVER },
+
+/* SECTION 3: Overlapping READ and WRITE and UNLOCK with the different processes (CLIENT/SERVER) */
+ /* Add new lock, differing types and processes, to middle of the list - exact overlap match - 3 */
+ {13, WRLOCK, 10, 10, PASS, SERVER },
+ {13, WRLOCK, 30, 10, PASS, SERVER },
+ {13, RDLOCK, 50, 10, PASS, SERVER },
+ /* Same lock type, different process */
+ {13, WRLOCK, 30, 10, FAIL, CLIENT },
+ {13, RDLOCK, 50, 10, PASS, CLIENT },
+ /* Exact match - different lock type, different process */
+ {13, RDLOCK, 30, 10, FAIL, CLIENT },
+ /* Exact match - unlock */
+ {13, UNLOCK, 30, 10, PASS, CLIENT },
+ /* New lock - as above, inserting in the list again */
+ {13, UNLOCK, 30, 10, PASS, SERVER },
+ /* Exact match - same lock type, different process */
+ {13, WRLOCK, 30, 10, PASS, CLIENT },
+
+ {13, UNLOCK, 10, 10, PASS, SERVER },
+ {13, UNLOCK, 30, 10, PASS, CLIENT },
+ {13, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add new lock, differing types and processes, which completely overlap any of the locks in the list - 4,5,6 */
+ {14, WRLOCK, 10, 10, PASS, SERVER },
+ {14, WRLOCK, 30, 10, PASS, SERVER },
+ {14, RDLOCK, 50, 10, PASS, SERVER },
+ /* The start is the same, end overlaps */
+ {14, RDLOCK, 30, 15, FAIL, CLIENT },
+ {14, WRLOCK, 30, 15, FAIL, CLIENT },
+ /* The start is before, end is the same */
+ {14, RDLOCK, 25, 20, FAIL, CLIENT },
+ {14, WRLOCK, 25, 20, FAIL, CLIENT },
+ /* Both start and end overlap */
+ {14, RDLOCK, 22, 26, FAIL, CLIENT },
+ {14, WRLOCK, 22, 26, FAIL, CLIENT },
+
+ /* The start is the same, end overlaps */
+ {14, RDLOCK, 50, 15, PASS, CLIENT },
+ {14, WRLOCK, 50, 17, FAIL, CLIENT },
+ /* The start is before, end is the same */
+ {14, RDLOCK, 45, 20, PASS, CLIENT },
+ {14, WRLOCK, 43, 22, FAIL, CLIENT },
+ /* Both start and end overlap */
+ {14, RDLOCK, 42, 26, PASS, CLIENT },
+ {14, WRLOCK, 41, 28, FAIL, CLIENT },
+
+ {14, UNLOCK, 10, 10, PASS, SERVER },
+ {14, UNLOCK, 22, 26, PASS, SERVER },
+ {14, UNLOCK, 42, 26, PASS, CLIENT },
+
+ /* Add new lock, differing types and processes, which are completely overlaped by an old lock in the list - 7,8,10 */
+ {15, WRLOCK, 10, 10, PASS, SERVER },
+ {15, RDLOCK, 30, 10, PASS, SERVER },
+ {15, WRLOCK, 50, 10, PASS, SERVER },
+ /* The start is the same, end is in the middle of old lock */
+ {15, RDLOCK, 50, 5, FAIL, CLIENT },
+ {15, WRLOCK, 50, 5, FAIL, CLIENT },
+ /* The start and end are in the middle of old lock */
+ {15, RDLOCK, 52, 6, FAIL, CLIENT },
+ {15, WRLOCK, 52, 6, FAIL, CLIENT },
+ /* Start in the middle and end is the same */
+ {15, RDLOCK, 52, 8, FAIL, CLIENT },
+ {15, WRLOCK, 52, 8, FAIL, CLIENT },
+ /* The start is the same, end is in the middle of old lock */
+ {15, RDLOCK, 30, 5, PASS, CLIENT },
+ {15, WRLOCK, 30, 5, FAIL, CLIENT },
+ /* The start and end are in the middle of old lock */
+ {15, RDLOCK, 32, 6, PASS, CLIENT },
+ {15, WRLOCK, 32, 6, FAIL, CLIENT },
+ /* Start in the middle and end is the same */
+ {15, RDLOCK, 32, 8, PASS, CLIENT },
+ {15, WRLOCK, 32, 8, FAIL, CLIENT },
+
+ {15, UNLOCK, 10, 10, PASS, SERVER },
+ {15, UNLOCK, 30, 10, PASS, SERVER },
+ {15, UNLOCK, 50, 10, PASS, SERVER },
+ /* Add new lock, differing types and processes, which start before a lock in the list - 2,9 */
+ {16, RDLOCK, 10, 10, PASS, SERVER },
+ {16, WRLOCK, 50, 10, PASS, SERVER },
+ /* Start is before, end is the start of the old lock in list */
+ {16, RDLOCK, 5, 6, PASS, CLIENT },
+ {16, WRLOCK, 5, 6, FAIL, CLIENT },
+ /* Start is before, end is in the middle of the old lock */
+ {16, RDLOCK, 5, 10, PASS, CLIENT },
+ {16, WRLOCK, 5, 10, FAIL, CLIENT },
+ /* Start is before, end is the start of the old lock in list */
+ {16, RDLOCK, 45, 6, FAIL, CLIENT },
+ {16, WRLOCK, 45, 6, FAIL, CLIENT },
+ /* Start is before, end is in the middle of the old lock */
+ {16, RDLOCK, 45, 10, FAIL, CLIENT },
+ {16, WRLOCK, 45, 10, FAIL, CLIENT },
+
+ {16, UNLOCK, 5, 15, PASS, CLIENT },
+ {16, UNLOCK, 30, 10, PASS, SERVER },
+ {16, UNLOCK, 50, 10, PASS, SERVER },
+
+ /* Add new lock, differing types and processes, which starts in the middle of a lock, and ends after - 11,12 */
+ {17, WRLOCK, 10, 10, PASS, SERVER },
+ {17, RDLOCK, 30, 10, PASS, SERVER },
+ {17, WRLOCK, 50, 10, PASS, SERVER },
+ /* Start in the middle, end after lock in list */
+ {17, WRLOCK, 35, 10, FAIL, CLIENT },
+ /* Start matches end of lock in list */
+ {17, RDLOCK, 35, 10, PASS, CLIENT },
+ {17, RDLOCK, 44, 2, PASS, CLIENT },
+ /* Start in the middle, end after lock in list */
+ {17, RDLOCK, 55, 10, FAIL, CLIENT },
+ {17, WRLOCK, 55, 10, FAIL, CLIENT },
+ /* Start matches end of lock in list */
+ {17, RDLOCK, 59, 5, FAIL, CLIENT },
+ {17, WRLOCK, 59, 5, FAIL, CLIENT },
+
+ {17, UNLOCK, 10, 10, PASS, SERVER },
+ {17, UNLOCK, 30, 16, PASS, CLIENT },
+ {17, UNLOCK, 50, 10, PASS, SERVER },
+
+/* SECTION 4: overlapping and EOF tests */
+ /* Acquire overlapping ranges */
+ {18, WRLOCK, 11, 7, PASS, SERVER },
+ {18, WRLOCK, 13, 8, FAIL, CLIENT },
+ {18, UNLOCK, 11, 7, PASS, SERVER },
+ /* Acquire different ranges beyond EOF */
+ {19, WRLOCK, 10, FILE_SIZE, PASS, SERVER },
+ {19, WRLOCK, FILE_SIZE + 10, 10, PASS, CLIENT },
+ {19, UNLOCK, 10, FILE_SIZE, PASS, SERVER },
+ {19, UNLOCK, FILE_SIZE + 10, 10, PASS, CLIENT },
+ /* Acquire same range beyong EOF */
+ {20, WRLOCK, 10, FILE_SIZE, PASS, SERVER, },
+ {20, WRLOCK, 10, FILE_SIZE, FAIL, CLIENT, },
+ {20, UNLOCK, 10, FILE_SIZE, PASS, SERVER, },
+ /* Acquire whole file lock */
+ {21, WRLOCK, 0, 0, PASS, SERVER, },
+ {21, WRLOCK, 0, 0, FAIL, CLIENT, },
+ {21, UNLOCK, 0, 0, PASS, SERVER, },
+ /* Acquire whole file lock, then range */
+ {22, WRLOCK, 0, 0, PASS, SERVER, },
+ {22, WRLOCK, 1, 5, FAIL, CLIENT, },
+ {22, UNLOCK, 0, 0, PASS, SERVER, },
+ /* Acquire non-overlapping read locks */
+ {23, RDLOCK, 1, 5, PASS, SERVER, },
+ {23, RDLOCK, 7, 6, PASS, CLIENT, },
+ {23, UNLOCK, 1, 5, PASS, SERVER, },
+ {23, UNLOCK, 7, 6, PASS, CLIENT, },
+ /* Acquire overlapping read locks */
+ {24, RDLOCK, 1, 5, PASS, SERVER, },
+ {24, RDLOCK, 2, 6, PASS, CLIENT, },
+ {24, UNLOCK, 1, 5, PASS, SERVER, },
+ {24, UNLOCK, 1, 7, PASS, CLIENT, },
+ /* Acquire non-overlapping read and write locks */
+ {25, RDLOCK, 1, 5, PASS, SERVER, },
+ {25, WRLOCK, 7, 6, PASS, CLIENT, },
+ {25, UNLOCK, 1, 5, PASS, SERVER, },
+ {25, UNLOCK, 7, 6, PASS, CLIENT, },
+ /* Acquire overlapping read and write locks */
+ {26, RDLOCK, 1, 5, PASS, SERVER, },
+ {26, WRLOCK, 2, 6, FAIL, CLIENT, },
+ {26, UNLOCK, 1, 5, PASS, SERVER, },
+ /* Acquire whole file lock, then close (without unlocking) */
+ {27, WRLOCK, 0, 0, PASS, SERVER, },
+ {27, WRLOCK, 1, 5, FAIL, CLIENT, },
+ {27, F_CLOSE,0, 0, PASS, SERVER, },
+ {27, WRLOCK, 1, 5, PASS, CLIENT, },
+ {27, F_OPEN, 0, 0, PASS, SERVER, },
+ {27, UNLOCK, 1, 5, PASS, CLIENT, },
+ /* Acquire two read locks, close one file and then reopen to check that first lock still exists */
+ {28, RDLOCK, 1, 5, PASS, SERVER, },
+ {28, RDLOCK, 1, 5, PASS, CLIENT, },
+ {28, F_CLOSE,0, 0, PASS, SERVER, },
+ {28, F_OPEN, 0, 0, PASS, SERVER, },
+ {28, WRLOCK, 0, 0, FAIL, SERVER, },
+ {28, UNLOCK, 1, 5, PASS, SERVER, },
+#ifdef macosx
+ /* Close the opened file and open the file with SHLOCK, other client will try to open with SHLOCK too */
+ {29, F_CLOSE,0, 0, PASS, SERVER, },
+ {29, F_OPEN, O_SHLOCK|O_NONBLOCK, 0, PASS, SERVER, },
+ {29, F_CLOSE,0, 0, PASS, CLIENT, },
+ {29, F_OPEN, O_SHLOCK|O_NONBLOCK, 0, PASS, CLIENT, },
+ /* Close the opened file and open the file with SHLOCK, other client will try to open with EXLOCK */
+ {30, F_CLOSE,0, 0, PASS, SERVER, },
+ {30, F_CLOSE,0, 0, PASS, CLIENT, },
+ {30, F_OPEN, O_SHLOCK|O_NONBLOCK, 0, PASS, SERVER, },
+ {30, F_OPEN, O_EXLOCK|O_NONBLOCK, 0, FAIL, CLIENT, },
+ /* Close the opened file and open the file with EXLOCK, other client will try to open with EXLOCK too */
+ {31, F_CLOSE,0, 0, PASS, SERVER, },
+ {31, F_CLOSE,0, 0, FAIL, CLIENT, },
+ {31, F_OPEN, O_EXLOCK|O_NONBLOCK, 0, PASS, SERVER, },
+ {31, F_OPEN, O_EXLOCK|O_NONBLOCK, 0, FAIL, CLIENT, },
+ {31, F_CLOSE,0, 0, PASS, SERVER, },
+ {31, F_CLOSE,0, 0, FAIL, CLIENT, },
+ {31, F_OPEN, 0, 0, PASS, SERVER, },
+ {31, F_OPEN, 0, 0, PASS, CLIENT, },
+#endif /* macosx */
+ /* indicate end of array */
+ {0,0,0,0,0,SERVER},
+ {0,0,0,0,0,CLIENT}
+ };
+
+static struct {
+ int32_t test;
+ int32_t command;
+ int64_t offset;
+ int64_t length;
+ int32_t result;
+ int32_t index;
+ int32_t error;
+ int32_t padding; /* So mac and irix have the same size struct (bloody alignment) */
+} ctl;
+
+
+void
+usage(void)
+{
+ fprintf(stderr, "Usage: %s [options] sharedfile\n\
+\n\
+options:\n\
+ -p port TCP/IP port number for client-server communication\n\
+ -d enable debug tracing\n\
+ -n # test number to run\n\
+ -h host run as client and connect to server on remote host\n\
+ [default run as server]\n", prog);
+ exit(1);
+}
+
+#define INIT_BUFSZ 512
+
+void
+initialize(HANDLE fd)
+{
+ char* ibuf;
+ int j=0;
+ int nwrite;
+ int offset = 0;
+ int togo = FILE_SIZE;
+
+ if (D_flag) {
+ ibuf = (char *)ALLOC_ALIGNED(INIT_BUFSZ);
+ }
+ else {
+ ibuf = (char*)malloc(INIT_BUFSZ);
+ }
+ memset(ibuf, ':', INIT_BUFSZ);
+
+ SEEK(fd, 0L);
+ while (togo) {
+ offset+=j;
+ j = togo > INIT_BUFSZ ? INIT_BUFSZ : togo;
+
+ if ((nwrite = WRITE(fd, ibuf, j)) != j) {
+ if (nwrite < 0)
+ perror("initialize write:");
+ else
+ fprintf(stderr, "initialize: write() returns %d, not %d as expected\n",
+ nwrite, j);
+ exit(1);
+ /*NOTREACHED*/
+ }
+ togo -= j;
+ }
+}
+
+
+int do_open(int flag)
+{
+ if ((f_fd = OPEN(filename, flag)) == INVALID_HANDLE) {
+ perror("shared file create");
+ if (!flag) /* Only exit if the first open fails */
+ exit(1);
+ closed = 0;
+ return FAIL;
+ /*NOTREACHED*/
+ }
+
+ closed = 0;
+
+#ifdef __sun
+ if (D_flag) {
+ directio(f_fd, DIRECTIO_ON);
+ }
+#elif defined(__APPLE__)
+ if (D_flag) {
+ fcntl(f_fd, F_NOCACHE, 1);
+ }
+#endif
+ return PASS;
+}
+
+int do_lock(int type, int start, int length)
+{
+ int ret;
+ int filedes = f_fd;
+ struct flock fl;
+
+ if(debug > 1) {
+ fprintf(stderr, "do_lock: start=%d, length=%d\n", start, length);
+ }
+
+ if (f_fd < 0)
+ return f_fd;
+
+ fl.l_start = start;
+ fl.l_len = length;
+ fl.l_whence = SEEK_SET;
+ fl.l_pid = getpid();
+ fl.l_type = type;
+
+ errno = 0;
+
+ ret = fcntl(filedes, F_SETLK, &fl);
+ saved_errno = errno;
+
+ if(debug > 1 && ret)
+ fprintf(stderr, "do_lock: ret = %d, errno = %d (%s)\n", ret, errno, strerror(errno));
+
+ return(ret==0?PASS:FAIL);
+}
+
+int do_unlock(int start, int length)
+{
+ int ret;
+ int filedes = f_fd;
+ struct flock fl;
+
+ if(debug > 1) {
+ fprintf(stderr, "do_unlock: start=%d, length=%d\n", start, length);
+ }
+
+ if (f_fd < 0)
+ return f_fd;
+
+ fl.l_start = start;
+ fl.l_len = length;
+ fl.l_whence = SEEK_SET;
+ fl.l_pid = getpid();
+ fl.l_type = F_UNLCK;
+
+ errno = 0;
+
+ ret = fcntl(filedes, F_SETLK, &fl);
+ saved_errno = errno;
+ if(debug > 1 && ret)
+ fprintf(stderr, "do_lock: ret = %d, errno = %d (%s)\n", ret, errno, strerror(errno));
+
+ return(ret==0?PASS:FAIL);
+}
+
+int do_close(void)
+{
+ if(debug > 1) {
+ fprintf(stderr, "do_close\n");
+ }
+
+ errno =0;
+ CLOSE(f_fd);
+
+ saved_errno = errno;
+
+ if (errno)
+ return FAIL;
+ return(PASS);
+}
+
+void
+send_ctl(void)
+{
+ int nwrite;
+
+ if (debug > 1) {
+ fprintf(stderr, "send_ctl: test=%d, command=%d offset=%"LL"d, length=%"LL"d, result=%d, error=%d\n",
+ ctl.test, ctl.command, ctl.offset, ctl.length,ctl.result, ctl.error);
+ }
+
+ ctl.test= bswap_uint32(ctl.test);
+ ctl.command = bswap_uint32(ctl.command);
+ ctl.offset = bswap_uint64(ctl.offset);
+ ctl.length = bswap_uint64(ctl.length);
+ ctl.result = bswap_uint32(ctl.result);
+ ctl.index= bswap_uint32(ctl.index);
+ ctl.error = bswap_uint32(ctl.error);
+ nwrite = SOCKET_WRITE(c_fd, (char*)&ctl, sizeof(ctl));
+
+ ctl.test= bswap_uint32(ctl.test);
+ ctl.command = bswap_uint32(ctl.command);
+ ctl.offset = bswap_uint64(ctl.offset);
+ ctl.length = bswap_uint64(ctl.length);
+ ctl.result = bswap_uint32(ctl.result);
+ ctl.index= bswap_uint32(ctl.index);
+ ctl.error= bswap_uint32(ctl.error);
+ if (nwrite != sizeof(ctl)) {
+ if (nwrite < 0)
+ perror("send_ctl: write");
+ else
+ fprintf(stderr, "send_ctl[%d]: write() returns %d, not %d as expected\n",
+ ctl.test, nwrite, sizeof(ctl));
+ exit(1);
+ /*NOTREACHED*/
+ }
+}
+
+void recv_ctl(void)
+{
+ int nread;
+
+ if ((nread = SOCKET_READ(c_fd, (char*)&ctl, sizeof(ctl))) != sizeof(ctl)) {
+ if (nread < 0)
+ perror("recv_ctl: read");
+ else {
+ fprintf(stderr, "recv_ctl[%d]: read() returns %d, not %d as expected\n",
+ ctl.test, nread, sizeof(ctl));
+ fprintf(stderr, "socket might has been closed by other locktest\n");
+ }
+ exit(1);
+ /*NOTREACHED*/
+ }
+ ctl.test= bswap_uint32(ctl.test);
+ ctl.command = bswap_uint32(ctl.command);
+ ctl.offset = bswap_uint64(ctl.offset);
+ ctl.length = bswap_uint64(ctl.length);
+ ctl.result = bswap_uint32(ctl.result);
+ ctl.index= bswap_uint32(ctl.index);
+ ctl.error= bswap_uint32(ctl.error);
+
+ if (debug > 1) {
+ fprintf(stderr, "recv_ctl: test=%d, command=%d offset=%"LL"d, length=%"LL"d, result=%d, error=%d\n",
+ ctl.test, ctl.command, ctl.offset, ctl.length, ctl.result, ctl.error);
+ }
+}
+
+void
+cleanup(void)
+{
+ if (f_fd>=0 && !reopen && !closed)
+ CLOSE(f_fd);
+
+ if (c_fd>=0)
+ SOCKET_CLOSE(c_fd);
+
+ if (s_fd>=0)
+ SOCKET_CLOSE(s_fd);
+
+ PLATFORM_CLEANUP();
+}
+
+int
+main(int argc, char *argv[])
+{
+ int i, sts;
+ int c;
+ struct sockaddr_in myAddr;
+ struct linger noLinger = {1, 0};
+ char *host;
+ char *endnum;
+ int errflag = 0;
+ char *p;
+ extern char *optarg;
+ extern int optind;
+ extern int errno;
+ int fail_count = 0;;
+
+ atexit(cleanup);
+
+ PLATFORM_INIT();
+
+ /* trim command name of leading directory components */
+ prog = argv[0];
+ for (p = prog; *p; p++) {
+ if (*p == '/')
+ prog = p+1;
+ }
+
+ while ((c = getopt(argc, argv, "dn:h:p:?")) != EOF) {
+ switch (c) {
+
+ case 'd': /* debug flag */
+ debug++;
+ break;
+
+ case 'h': /* (server) hostname */
+ server = 0;
+ host = optarg;
+ break;
+
+ case 'n':
+ testnumber = atoi(optarg);
+ break;
+
+ case 'p': /* TCP/IP port */
+ port = (int)strtol(optarg, &endnum, 10);
+ if (*endnum != '\0') {
+ fprintf(stderr, "%s: -p argument must be a numeric\n",
+ prog);
+ exit(1);
+ /*NOTREACHED*/
+ }
+ break;
+
+ case '?':
+ default:
+ errflag++;
+ break;
+ }
+ }
+
+ if (errflag || optind != argc-1) {
+ usage();
+ /*NOTREACHED*/
+ }
+
+ filename=argv[optind];
+ do_open(0);
+
+ /*
+ * +10 is slop for the iteration number if do_write() ... never
+ * needed unless maxio is very small
+ */
+ if (D_flag) {
+ if ((buf = (char *)ALLOC_ALIGNED(maxio + 10)) == NULL) {
+ perror("aligned alloc buf");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ } else {
+ if ((buf = (char *)malloc(maxio + 10)) == NULL) {
+ perror("malloc buf");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ }
+
+ setbuf(stderr, NULL);
+
+ if (server) {
+ int one = 1;
+
+ s_fd = socket(AF_INET, SOCK_STREAM, 0);
+ if (s_fd == INVALID_SOCKET) {
+ perror("socket");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ if (setsockopt(s_fd, IPPROTO_TCP, TCP_NODELAY, (char*)&one, sizeof(one)) < 0) {
+ perror("setsockopt(nodelay)");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ if (setsockopt(s_fd, SOL_SOCKET, SO_REUSEADDR, (char*)&one, sizeof(one))<0) {
+ perror("setsockopt(reuseaddr)");
+ exit(1);
+ /*NOTREACHED*/
+ }
+#ifdef SO_REUSEPORT
+ if (setsockopt(s_fd, SOL_SOCKET, SO_REUSEPORT, (char*)&one, sizeof(one))<0) {
+ perror("setsockopt(reuseport)");
+ exit(1);
+ /*NOTREACHED*/
+ }
+#endif
+
+ memset(&myAddr, 0, sizeof(myAddr));
+ myAddr.sin_family = AF_INET;
+ myAddr.sin_addr.s_addr = htonl(INADDR_ANY);
+ myAddr.sin_port = htons((short)port);
+ sts = bind(s_fd, (struct sockaddr*)&myAddr, sizeof(myAddr));
+ if (sts < 0) {
+ perror("bind");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ sts = listen(s_fd, 5); /* Max. of 5 pending connection requests */
+ if (sts == -1) {
+ perror("listen");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ c_fd = accept(s_fd, NULL, NULL);
+ if (c_fd == INVALID_SOCKET) {
+ perror("accept");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ if (debug) fprintf(stderr, "Client accepted\n");
+ SRAND(12345L);
+ }
+ else {
+ struct hostent *servInfo;
+
+ if ((servInfo = gethostbyname(host)) == NULL) {
+ perror("gethostbyname");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ c_fd = socket(AF_INET, SOCK_STREAM, 0);
+ if (c_fd == INVALID_SOCKET) {
+ perror("socket");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ /* avoid 200 ms delay */
+ if (setsockopt(c_fd, IPPROTO_TCP, TCP_NODELAY, (char *)&i, sizeof(i)) < 0) {
+ perror("setsockopt(nodelay)");
+ exit(1);
+ /*NOTREACHED*/
+ }
+ /* Don't linger on close */
+ if (setsockopt(c_fd, SOL_SOCKET, SO_LINGER, (char *)&noLinger, sizeof(noLinger)) < 0) {
+ perror("setsockopt(nolinger)");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ memset(&myAddr, 0, sizeof(myAddr)); /* Arrgh! &myAddr, not myAddr */
+ myAddr.sin_family = AF_INET;
+ memcpy(&myAddr.sin_addr, servInfo->h_addr, servInfo->h_length);
+ myAddr.sin_port = htons((short)port);
+
+ if (connect(c_fd, (struct sockaddr*)&myAddr, sizeof(myAddr)) < 0) {
+ perror("unable to connect");
+ fprintf(stderr, "Server might still initializing the shared file\n ");
+ exit(1);
+ /*NOTREACHED*/
+ }
+
+ if (debug) fprintf(stderr, "Connected to server\n");
+ SRAND(6789L);
+ }
+
+ if (server)
+ /* only server need do shared file */
+ initialize(f_fd);
+
+ /*
+ * TCP/IP connection to be established, safe to proceed.
+ *
+ * real work is in here ...
+ */
+ i = 0;
+{
+ int index = 0;
+ int end = 0;
+ int result = 0;
+ int last_test = 0;
+ int test_count = 0;
+ int fail_flag = 0;
+ while(!end) {
+ if (server) {
+ if(testnumber > 0) {
+ last_test = testnumber - 1;
+ while(tests[index][TEST_NUM] != testnumber && tests[index][TEST_NUM] != 0) {
+ index++;
+ }
+ }
+ /* If we have a server command, deal with it */
+ if(tests[index][WHO] == SERVER) {
+ if(debug>1)
+ fprintf(stderr, "Got a server command (%d)\n", index);
+ if(tests[index][TEST_NUM] == 0) {
+ index++;
+ continue;
+ }
+ memset(&ctl, 0, sizeof(ctl));
+ ctl.test = tests[index][TEST_NUM];
+
+ if(tests[index][TEST_NUM] != 0) {
+ switch(tests[index][COMMAND]) {
+ case WRLOCK:
+ result = do_lock(F_WRLCK, tests[index][OFFSET], tests[index][LENGTH]);
+ break;
+ case RDLOCK:
+ result = do_lock(F_RDLCK, tests[index][OFFSET], tests[index][LENGTH]);
+ break;
+ case UNLOCK:
+ result = do_unlock(tests[index][OFFSET], tests[index][LENGTH]);
+ break;
+ case F_CLOSE:
+ result = do_close();
+ break;
+ case F_OPEN:
+ result = do_open(tests[index][FLAGS]);
+ break;
+ }
+ if( result != tests[index][RESULT]) {
+ fail_flag++;
+ /* We have a failure */
+ if(debug)
+ fprintf(stderr, "Server failure in test %d, while %sing using offset %llu, length %llu - err = %d:%s\n",
+ ctl.test, tests[index][COMMAND]==WRLOCK?"write lock":
+ tests[index][COMMAND]==RDLOCK?"read lock":
+ tests[index][COMMAND]==UNLOCK?"unlock":
+ tests[index][COMMAND]==F_OPEN?"open":"clos",
+ tests[index][OFFSET], tests[index][LENGTH], saved_errno, strerror(saved_errno));
+ fprintf(stderr, "Server failure in %llu:%s\n",
+ tests[index][TEST_NUM],
+ descriptions[tests[index][TEST_NUM] - 1]);
+ }
+ }
+ /* else send it off to the client */
+ } else if (tests[index][WHO] == CLIENT) {
+ if(tests[index][TEST_NUM] == 0) {
+ ctl.test = 0;
+ end=1;
+ }
+ if(debug > 1)
+ fprintf(stderr, "Sending command to client (%d) - %s - %llu:%llu\n",
+ index, tests[index][COMMAND]==WRLOCK?"write lock":
+ tests[index][COMMAND]==RDLOCK?"read lock":
+ tests[index][COMMAND]==UNLOCK?"unlock":
+ tests[index][COMMAND]==F_OPEN?"open":"clos",
+ tests[index][OFFSET], tests[index][LENGTH]);
+ /* get the client to do something */
+ ctl.index = index;
+ send_ctl();
+ if(ctl.test != 0) {
+ /* Get the clients response */
+ recv_ctl();
+ /* this is the whether the test passed or failed,
+ * not what the command returned */
+ if( ctl.result == FAIL ) {
+ fail_flag++;
+ if(debug)
+ fprintf(stderr, "Client failure in test %d, while %sing using offset %llu, length %llu - err = %d:%s\n",
+ ctl.test, ctl.command==WRLOCK?"write lock":
+ ctl.command==RDLOCK?"read lock":
+ ctl.command==UNLOCK?"unlock":
+ ctl.command==F_OPEN?"open":"clos",
+ ctl.offset, ctl.length, ctl.error, strerror(ctl.error));
+ fprintf(stderr, "Client failure in %llu:%s\n",
+ tests[index][TEST_NUM],
+ descriptions[tests[index][TEST_NUM] - 1]);
+ }
+ }
+ }
+ if (debug > 1) {
+ fprintf(stderr, "server sleeping ...\n");
+ SLEEP(1);
+ }
+ if(tests[index][TEST_NUM] != 0) {
+ if(last_test != tests[index][TEST_NUM]) {
+ test_count++;
+ if(fail_flag)
+ fail_count++;
+ fail_flag = 0;
+
+ }
+ last_test = tests[index][TEST_NUM];
+ }
+
+ index++;
+ } else { /* CLIENT */
+ if(debug > 2)
+ fprintf(stderr,"client: waiting...\n");
+ /* wait for the server to do something */
+ recv_ctl();
+
+ /* check for a client command */
+ index = ctl.index;
+ if (tests[index][WHO] != CLIENT) {
+ fprintf(stderr, "not a client command index (%d)\n", index);
+ exit(1);
+ }
+
+ if(ctl.test == 0) {
+ end = 1;
+ break;
+ }
+
+
+ ctl.command = tests[index][COMMAND];
+ ctl.offset = tests[index][OFFSET];
+ ctl.length = tests[index][LENGTH];
+ switch(tests[index][COMMAND]) {
+ case WRLOCK:
+ result = do_lock(F_WRLCK, tests[index][OFFSET], tests[index][LENGTH]);
+ break;
+ case RDLOCK:
+ result = do_lock(F_RDLCK, tests[index][OFFSET], tests[index][LENGTH]);
+ break;
+ case UNLOCK:
+ result = do_unlock(tests[index][OFFSET], tests[index][LENGTH]);
+ break;
+ case F_CLOSE:
+ result = do_close();
+ break;
+ case F_OPEN:
+ result = do_open(tests[index][FLAGS]);
+ break;
+ }
+ if( result != tests[index][RESULT] ) {
+ if(debug)
+ fprintf(stderr,"Got %d, wanted %llu\n", result, tests[index][RESULT]);
+ ctl.result = FAIL;
+ ctl.error = saved_errno;
+ fail_count++;
+ } else {
+ ctl.result = PASS;
+ }
+ if(debug > 2)
+ fprintf(stderr,"client: sending result to server (%d)\n", ctl.index);
+ /* Send result to the server */
+ send_ctl();
+ if(tests[index][TEST_NUM] != 0) {
+ if(last_test != tests[index][TEST_NUM])
+ test_count++;
+ last_test = tests[index][TEST_NUM];
+ }
+ }
+ }
+ if(server)
+ printf("%d tests run, %d failed\n", test_count, fail_count);
+}
+ if (buf) {
+ if (D_flag)
+ FREE_ALIGNED(buf);
+ else
+ free(buf);
+ }
+
+
+ exit(fail_count);
+ /*NOTREACHED*/
+}
+
+
--- /dev/null
+/*
+ * Copyright 2002 Silicon Graphics, Inc. ALL RIGHTS RESERVED
+ *
+ * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND
+ *
+ * Use, duplication or disclosure by the Government is subject to restrictions
+ * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the
+ * Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
+ * and/or in similar or successor clauses in the FAR, or the DOD or NASA FAR
+ * Supplement. Unpublished -- rights reserved under the Copyright Laws
+ * of the United States. Contractor/manufacturer is Silicon Graphics, Inc.,
+ * 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI
+ *
+ * The copyright notice above does not evidence any actual or intended
+ * publication or disclosure of this source code, which includes information
+ * that is the confidential and/or proprietary, and is a trade secret,
+ * of Silicon Graphics, Inc. Any use, duplication or disclosure not
+ * specifically authorized in writing by Silicon Graphics is strictly
+ * prohibited. ANY DUPLICATION, MODIFICATION, DISTRIBUTION,PUBLIC PERFORMANCE,
+ * OR PUBLIC DISPLAY OF THIS SOURCE CODE WITHOUT THE EXPRESS WRITTEN CONSENT
+ * OF SILICON GRAPHICS, INC. IS STRICTLY PROHIBITED. THE RECEIPT OR POSSESSION
+ * OF THIS SOURCE CODE AND/OR INFORMATION DOES NOT CONVEY ANY RIGHTS
+ * TO REPRODUCE, DISCLOSE OR DISTRIBUTE ITS CONTENTS, OR TO MANUFACTURE, USE,
+ * OR SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART.
+ */
+
+/* dxm - 28/2/2 */
+
+#define _GNU_SOURCE
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+
+FILE *fp = NULL;
+
+#define LL "ll"
+
+#define PERROR(a,b) perror(a)
+#define GET_LAST_ERROR errno
+
+#define HANDLE int
+#define INVALID_HANDLE -1
+#define TRUNCATE_ERROR -1
+#define FLUSH_ERROR EOF
+
+#define FILE_BEGIN SEEK_SET
+#define FILE_CURRENT SEEK_CUR
+
+#define OPEN(N, F) open(N, O_CREAT|O_RDWR|F, 0644); fp = fdopen(f, "r+")
+#define SEEK(H, O, F) (lseek(H, O, F))
+#define READ(H, B, L) (read(H, B, L))
+#define WRITE(H, B, L) (write(H, B, L))
+#define CLOSE(H) (close(H))
+#define DELETE_FILE(F) (unlink(F))
+#define FLUSH(F) (fflush(fp))
+#define TRUNCATE(F) (ftruncate(F, 0))
+
+#define ALLOC_ALIGNED(S) (memalign(65536, S))
+#define FREE_ALIGNED(P) (free(P))
+
+#define DIRECT_IO_FLAG O_DIRECT
+
+enum {
+ FLAG_OPENCLOSE = 1,
+ FLAG_READ = 2,
+ FLAG_WRITE = 4,
+ FLAG_VERBOSE = 8,
+ FLAG_TRUNCATE = 16,
+ FLAG_SEQUENTIAL = 32,
+ FLAG_FLUSH = 64,
+ FLAG_DELETE = 128,
+ FLAG_DIRECT = 256,
+};
+
+void
+usage(char *argv0)
+{
+ printf(
+ "Usage: %s [switches] <filename>\n"
+ " -i <count> = repeat count (default forever)\n"
+ " -o = open/close\n"
+ " -r = read\n"
+ " -w = write\n"
+ " -t = truncate\n"
+ " -d = delete\n"
+ " -b <size> = buffer size\n"
+ " -v = verbose\n"
+ " -s = sequential\n"
+ " -f = flush\n"
+ " -D = direct-IO\n"
+ " -h = usage\n",
+ argv0);
+}
+
+extern int optind;
+extern char *optarg;
+
+int
+main(int argc, char *argv[])
+{
+ HANDLE f = INVALID_HANDLE;
+ char *filename;
+ int i;
+ int c;
+ int count = -1;
+ int bufsize = 4096;
+ int flags = 0;
+ char *buf = NULL;
+ int64_t seek_to = 0;
+
+ while ((c = getopt(argc, argv, "i:orwb:svthfFDd?")) != EOF) {
+ switch (c) {
+ case 'i':
+ count = atoi(optarg);
+ break;
+ case 'o':
+ flags |= FLAG_OPENCLOSE;
+ break;
+ case 'r':
+ flags |= FLAG_READ;
+ break;
+ case 'w':
+ flags |= FLAG_WRITE;
+ break;
+ case 't':
+ flags |= FLAG_TRUNCATE;
+ break;
+ case 'v':
+ flags |= FLAG_VERBOSE;
+ break;
+ case 'b':
+ bufsize = atoi(optarg);
+ break;
+ case 's':
+ flags |= FLAG_SEQUENTIAL;
+ break;
+ case 'f':
+ flags |= FLAG_FLUSH;
+ break;
+ case 'D':
+ flags |= FLAG_DIRECT;
+ break;
+ case 'd':
+ flags |= FLAG_DELETE;
+ break;
+ case '?':
+ case 'h':
+ default:
+ usage(argv[0]);
+ return 1;
+ }
+ }
+ if (optind != argc - 1) {
+ usage(argv[0]);
+ return 1;
+ }
+
+ filename = argv[optind];
+ if (!flags) {
+ fprintf(stderr, "nothing to do!\n");
+ exit(1);
+ }
+
+ if (flags & FLAG_DIRECT)
+ buf = (char *)ALLOC_ALIGNED(bufsize);
+ else
+ buf = (char *)malloc(bufsize);
+
+ if (!buf)
+ PERROR("malloc", GET_LAST_ERROR);
+
+ for (i = 0; i < bufsize; i++) {
+ buf[i] = i & 127;
+ }
+
+ for (i = 0; count < 0 || i < count; i++) {
+
+ if ((flags & FLAG_OPENCLOSE) || !i) {
+ int fileflags;
+
+ if (flags & FLAG_VERBOSE)
+ printf("open %s\n", filename);
+
+ fileflags = 0;
+ if (flags & FLAG_DIRECT)
+ fileflags |= DIRECT_IO_FLAG;
+
+ f = OPEN(filename, fileflags);
+ if (f == INVALID_HANDLE)
+ PERROR("OPEN", GET_LAST_ERROR);
+
+ }
+
+ if ((flags & FLAG_OPENCLOSE) && (flags & FLAG_SEQUENTIAL)) {
+ if (flags & FLAG_VERBOSE)
+ printf("seek %" LL "d\n", seek_to);
+ if (SEEK(f, seek_to, FILE_BEGIN) < 0)
+ PERROR("SEEK", GET_LAST_ERROR);
+ }
+
+ if (flags & FLAG_WRITE) {
+ int sizewritten;
+
+ if (!(flags & FLAG_SEQUENTIAL)) {
+ if (flags & FLAG_VERBOSE)
+ printf("seek %" LL "d\n", seek_to);
+ if (SEEK(f, seek_to, FILE_BEGIN) < 0)
+ PERROR("SEEK", GET_LAST_ERROR);
+ }
+
+ if (flags & FLAG_VERBOSE)
+ printf("write %d\n", bufsize);
+ if ((sizewritten = WRITE(f, buf, bufsize)) != bufsize) {
+ if (sizewritten < 0)
+ PERROR("WRITE", GET_LAST_ERROR);
+ else
+ fprintf(stderr, "short write: %d of %d\n",
+ sizewritten, bufsize);
+ }
+ }
+
+ if (flags & FLAG_READ) {
+ int sizeread;
+
+ if (!(flags & FLAG_SEQUENTIAL) || (flags & FLAG_WRITE)) {
+ if (flags & FLAG_VERBOSE)
+ printf("seek %" LL "d\n", seek_to);
+ if (SEEK(f, seek_to, FILE_BEGIN) < 0)
+ PERROR("SEEK", GET_LAST_ERROR);
+ }
+
+ if (flags & FLAG_VERBOSE)
+ printf("read %d\n", bufsize);
+ if ((sizeread = READ(f, buf, bufsize)) != bufsize) {
+ if (sizeread < 0)
+ PERROR("READ", GET_LAST_ERROR);
+ else if (sizeread)
+ fprintf(stderr, "short read: %d of %d\n",
+ sizeread, bufsize);
+ else {
+ fprintf(stderr, "Read past EOF\n");
+ exit(0);
+ }
+ }
+ }
+
+ if (flags & FLAG_TRUNCATE) {
+ if (flags & FLAG_VERBOSE)
+ printf("seek 0\n");
+
+ if (SEEK(f, 0, FILE_BEGIN) < 0)
+ PERROR("SEEK", GET_LAST_ERROR);
+
+ if (flags & FLAG_VERBOSE)
+ printf("truncate\n");
+
+ if (TRUNCATE(f) == TRUNCATE_ERROR)
+ PERROR("TRUNCATE", GET_LAST_ERROR);
+ }
+
+ if (flags & FLAG_FLUSH) {
+ if (flags & FLAG_VERBOSE)
+ printf("flush\n");
+
+ if (FLUSH(f) == FLUSH_ERROR)
+ PERROR("FLUSH", GET_LAST_ERROR);
+ }
+
+ if (flags & FLAG_SEQUENTIAL) {
+ seek_to += bufsize;
+ if (flags & FLAG_TRUNCATE) {
+ if (flags & FLAG_VERBOSE)
+ printf("seek %" LL "d\n", seek_to);
+ if (SEEK(f, seek_to, FILE_BEGIN) < 0)
+ PERROR("SEEK", GET_LAST_ERROR);
+ }
+ }
+
+ if (flags & FLAG_OPENCLOSE) {
+ if (flags & FLAG_VERBOSE)
+ printf("close %s\n", filename);
+ CLOSE(f);
+ }
+
+ if (flags & FLAG_DELETE) {
+ if (flags & FLAG_VERBOSE)
+ printf("delete %s\n", filename);
+ DELETE_FILE(filename);
+ }
+ }
+
+ if (buf) {
+ if (flags & FLAG_DIRECT)
+ FREE_ALIGNED(buf);
+ else
+ free(buf);
+ }
+
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+int main(void) {
+ return 1;
+}
--- /dev/null
+/*
+ * Copyright (c) 2000-2003 Silicon Graphics, Inc.
+ * All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <time.h>
+#include <stdio.h>
+
+#define O_DIRECT 040000
+
+#define WAITTIME 60
+#define BUFSIZE 4096
+#define ALIGNMENT 16384
+#define TRUNCSIZE 1000
+
+/* write data to disk - buffered/sync or direct
+ * write different buffered data to disk
+ * truncate
+ * direct read back, see if server puts stale data down
+ */
+
+int
+main(argc, argv)
+int argc;
+char **argv;
+{
+ int fd, err, elapsed;
+ char *buf, *goodbuf;
+ time_t starttime;
+ char ch, *filename="testfile";
+ int c;
+
+if(argc != 3)
+ { printf("Usage: trunc -f testfilename\n");
+ exit(1);
+ }
+
+while((c=getopt(argc,argv,"f:"))!=EOF) {
+ ch = (char)c;
+ switch (c) {
+ case 'f':
+ filename = optarg;
+ break;
+ default:
+ fprintf(stderr,"Usage: trunc -f filename\n");
+ exit(1);
+ }
+ }
+
+ err = posix_memalign(&buf, ALIGNMENT, BUFSIZE);
+ if (err < 0) perror("posix_memalign failed");
+
+ err = posix_memalign(&goodbuf, ALIGNMENT, BUFSIZE);
+ if (err < 0) perror("posix_memalign failed");
+
+ err = unlink(filename);
+/* if (err < 0) perror("unlink failed");*/
+
+ fd = open(filename, O_CREAT|O_RDWR|O_DIRECT, 0666);
+ if (fd < 0) perror("direct open failed");
+
+ memset(buf, 1, BUFSIZE);
+
+ printf("direct write of 1's into file\n");
+ err = write(fd, buf, BUFSIZE);
+ if (err < 0) perror("buffered write failed");
+
+ close(fd);
+
+ fd = open(filename, O_CREAT|O_RDWR, 0666);
+ if (fd < 0) perror("buffered open failed");
+
+ /* 1 now on disk */
+
+ memset(buf, 2, BUFSIZE);
+ memset(goodbuf, 2, BUFSIZE);
+
+ printf("buffered write of 2's into file\n");
+ err = write(fd, buf, BUFSIZE);
+ if (err < 0) perror("direct write failed");
+
+ /* 1 now on disk, but 2 data is buffered */
+
+ printf("truncate file\n");
+ err = ftruncate(fd, TRUNCSIZE);
+ if (err < 0) perror("ftruncate failed");
+ starttime = time(NULL);
+
+ printf("sync buffered data (2's)\n");
+ err = fdatasync(fd);
+ if (err < 0) perror("fdatasync failed");
+
+ /* during truncate server may have read/modified/written last block */
+
+ close(fd);
+
+ fd = open(filename, O_CREAT|O_RDWR|O_DIRECT, 0666);
+ if (fd < 0) perror("direct open failed");
+
+ /* read what's really on disk now */
+
+ printf("iterate direct reads for %ds or until failure...\n", WAITTIME);
+
+ while ((elapsed = (time(NULL) - starttime)) <= WAITTIME) {
+
+ /* printf(".");
+ fflush(stdout);*/
+
+ err = lseek(fd, 0, SEEK_SET);
+ if (err < 0) perror("lseek failed");
+
+ err = read(fd, buf, BUFSIZE);
+ if (err < 0) perror("read failed");
+
+ err = memcmp(buf, goodbuf, 100);
+ if (err) {
+ printf("\nFailed after %d secs: read %d's\n", elapsed, buf[0]);
+ return 1;
+ }
+
+ sleep(1);
+ }
+
+ free(buf);
+ free(goodbuf);
+
+ printf("Passed\n");
+ return 0;
+}
+
+