map_cmd=$4
filter_cmd=$5
testfile=$6
- xfs_io_opt=$7 #needs to be -F if not testing xfs
echo " 1. into a hole"
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "$zero_cmd 4k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
[ $? -ne 0 ] && die_now
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 0 20k" $sync_cmd \
-c "$zero_cmd 4k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "$alloc_cmd 0 20k" \
-c "$zero_cmd 4k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 8k 8k" $sync_cmd \
-c "$zero_cmd 4k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "$alloc_cmd 8k 8k" \
-c "$zero_cmd 4k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 0 8k" $sync_cmd \
-c "$zero_cmd 4k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 0 8k" $sync_cmd \
-c "$alloc_cmd 8k 8k" \
-c "$zero_cmd 4k 8k" \
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "$alloc_cmd 0 8k" \
-c "$zero_cmd 4k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "$alloc_cmd 0 8k" \
-c "pwrite 8k 8k" $sync_cmd \
-c "$zero_cmd 4k 8k" \
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 8k 4k" $sync_cmd \
-c "$zero_cmd 4k 12k" \
-c "$map_cmd -v" $testfile | $filter_cmd
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "$alloc_cmd 0 20k" \
-c "pwrite 0 8k" \
-c "pwrite 12k 8k" $sync_cmd \
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "$alloc_cmd 0 20k" \
-c "pwrite 8k 4k" $sync_cmd \
-c "$zero_cmd 4k 12k" \
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "$alloc_cmd 0 20k" \
-c "pwrite 0k 8k" $sync_cmd \
-c "pwrite 12k 8k" -c "fsync" \
echo " 14. data -> hole @ EOF"
rm -f $testfile
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 0 20k" $sync_cmd \
-c "$zero_cmd 12k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
if [ "$remove_testfile" ]; then
rm -f $testfile
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 0 20k" $sync_cmd \
-c "$zero_cmd 0k 8k" \
-c "$map_cmd -v" $testfile | $filter_cmd
else
cp $testfile $testfile.2
fi
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 8k 12k" -c "fsync" $testfile.2 \
> /dev/null
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+ $XFS_IO_PROG -f -c "truncate 20k" \
-c "pwrite 0 20k" $sync_cmd \
-c "$zero_cmd 0k 8k" \
-c "fadvise -d" \
rm -f $testfile
fi
block_size=`stat -f $TEST_DEV | grep "Block size" | cut -d " " -f3`
- $XFS_IO_PROG $xfs_io_opt -f -c "truncate $block_size" \
+ $XFS_IO_PROG -f -c "truncate $block_size" \
-c "pwrite 0 $block_size" $sync_cmd \
-c "$zero_cmd 128 128" \
-c "$map_cmd -v" $testfile | $filter_cmd
$DF_PROG $TEST_DEV
exit 1
fi
+
+ # Figure out if we need to add -F ("foreign", deprecated) option to xfs_io
+ xfs_io -c stat $TEST_DIR 2>&1 | grep -q "is not on an XFS filesystem" && \
+ export XFS_IO_PROG="$XFS_IO_PROG -F"
+
fi
# make sure this script returns success
dd if=/dev/zero of=$SCRATCH_MNT/file bs=4k count=1 seek=$((i*10))
done
# truncate last extent
-$XFS_IO_PROG -F -f -c "truncate $((4096*200))" $SCRATCH_MNT/file
+$XFS_IO_PROG -f -c "truncate $((4096*200))" $SCRATCH_MNT/file
if ! _scratch_unmount; then
echo "failed to umount"
_scratch_mount
echo "End-of-file zeroing with direct I/O"
-xfs_io -F -f -d -t -c "pwrite -S 0x63 0 65536" \
+$XFS_IO_PROG -f -d -t -c "pwrite -S 0x63 0 65536" \
-c "truncate 1" \
-c "pwrite -S 0x41 65536 65536" \
-c "pread -v 0 131072" \
echo
echo "Basic Block Hole test"
-xfs_io -F -f -t -c "truncate 8192" \
+$XFS_IO_PROG -f -t -c "truncate 8192" \
-c "pread -v 5000 3000" \
$SCRATCH_MNT/blackhole | _filter_xfs_io_unique
echo
echo "Test buffered and direct IO coherency"
-xfs_io -F -f -t -c "pwrite -S 0x41 8000 1000" \
+$XFS_IO_PROG -f -t -c "pwrite -S 0x41 8000 1000" \
-c "pwrite -S 0x57 4000 1000" \
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
-xfs_io -F -d -c "pwrite -S 0x78 20480 4096"\
+$XFS_IO_PROG -d -c "pwrite -S 0x78 20480 4096"\
-c "pwrite -S 0x79 4096 4096"\
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
-xfs_io -F -c "pread -v 0 9000"\
+$XFS_IO_PROG -c "pread -v 0 9000"\
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
echo
echo "Test direct read and write"
-xfs_io -F -f -d -t -c "pwrite -S 0x78 0 65536"\
+$XFS_IO_PROG -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_unique
-xfs_io -F -d -c "pread -v 0 6619136"\
+$XFS_IO_PROG -d -c "pread -v 0 6619136"\
$SCRATCH_MNT/direct_io | _filter_xfs_io_unique
-xfs_io -F -f -d -t -c "pwrite -S 0x61 0 65536"\
+$XFS_IO_PROG -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_unique
-xfs_io -F -d -c "pread -v 0 131072"\
+$XFS_IO_PROG -d -c "pread -v 0 131072"\
$SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
echo
echo "FSB Edge test"
-xfs_io -F -f -t -c "truncate 131072"\
+$XFS_IO_PROG -f -t -c "truncate 131072"\
-c "pwrite -S 0x5F 0 131072"\
-c "truncate 0"\
-c "truncate 131072"\
echo "Open Trunk test (O_TRUNC)"
for n in 0 1 2 3 4
do
- xfs_io -F -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
+ $XFS_IO_PROG -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
echo "Test" > $SCRATCH_MNT/$n
- xfs_io -F -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
+ $XFS_IO_PROG -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
cat $SCRATCH_MNT/$n
done
echo "DONE"
echo
echo "Append test"
echo "append to me" > $SCRATCH_MNT/append
-xfs_io -F -a -c "pwrite -S 0x61 0 10" \
+$XFS_IO_PROG -a -c "pwrite -S 0x61 0 10" \
-c "pread -v 0 24"\
$SCRATCH_MNT/append | _filter_xfs_io_unique
echo
echo "Small Vector Async"
echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
-xfs_io -F -f -c "pread -v 0 1"\
+$XFS_IO_PROG -f -c "pread -v 0 1"\
-c "pread -v 1 1"\
-c "pread -v 2 1"\
-c "pread -v 3 1"\
echo
echo "Small Vector Sync"
echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
-xfs_io -F -f -s -c "pread -v 0 1"\
+$XFS_IO_PROG -f -s -c "pread -v 0 1"\
-c "pread -v 1 1"\
-c "pread -v 2 1"\
-c "pread -v 3 1"\
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
-xfs_io -F -f -t -c "pwrite -S 0x63 0 512" \
+$XFS_IO_PROG -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 "pread -v 3584 512" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x63 4096 1024" \
+$XFS_IO_PROG -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 7168 1024" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x6E 8192 2048" \
+$XFS_IO_PROG -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 10240 2048" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x70 12288 4096" \
+$XFS_IO_PROG -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_unique
-xfs_io -F -f -c "pwrite -S 0x71 16384 8192" \
+$XFS_IO_PROG -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 16384 8192" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x73 32768 16384" \
+$XFS_IO_PROG -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 49152 16384" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x75 65536 32768" \
+$XFS_IO_PROG -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 98304 32768" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x76 131072 65536" \
+$XFS_IO_PROG -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 196608 65536" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x76 262144 131072" \
+$XFS_IO_PROG -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 393216 131072" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x76 524288 524288" \
+$XFS_IO_PROG -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_unique
-xfs_io -F -f -c "pwrite -S 0x32 1048576 1048576" \
+$XFS_IO_PROG -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 "pread -v 8388608 1048576" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x32 1048576 1048576" \
+$XFS_IO_PROG -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 "pread -v 9437184 1048576" \
$SCRATCH_MNT/aligned_vector_rw | _filter_xfs_io_unique
-xfs_io -F -f -c "pwrite -S 0x92 10485760 10485760" \
+$XFS_IO_PROG -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" \
_setup_testdir
echo "Buffered writer, buffered reader"
-xfs_io -F -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-xfs_io -F -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-xfs_io -F -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
+$XFS_IO_PROG -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
wait
rm $testdir/io_test
echo "Direct writer, buffered reader"
-xfs_io -F -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-xfs_io -F -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-xfs_io -F -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
+$XFS_IO_PROG -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
wait
rm $testdir/io_test
echo "Buffered writer, direct reader"
-xfs_io -F -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-xfs_io -F -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-xfs_io -F -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
+$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
wait
rm $testdir/io_test
echo "Direct writer, direct reader"
-xfs_io -F -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
-xfs_io -F -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
-xfs_io -F -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 512m' $testdir/io_test >/dev/null &
+$XFS_IO_PROG -d -c 'pread -b 64k 0 512m' $testdir/io_test > /dev/null
wait
rm $testdir/io_test
cd $SCRATCH_MNT
# create file with async I/O
-xfs_io -F -f -c 'pwrite -b 4k -S 0x12 0 4k' async_file > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x12 0 4k' async_file > /dev/null
# create file with sync I/O
-xfs_io -F -f -s -c 'pwrite -b 4k -S 0x34 0 4k' sync_file > /dev/null
+$XFS_IO_PROG -f -s -c 'pwrite -b 4k -S 0x34 0 4k' sync_file > /dev/null
# create file with sync I/O
-xfs_io -F -f -d -c 'pwrite -b 4k -S 0x56 0 4k' direct_file > /dev/null
+$XFS_IO_PROG -f -d -c 'pwrite -b 4k -S 0x56 0 4k' direct_file > /dev/null
# create file, truncate and then dirty again
-xfs_io -F -f -c 'pwrite -b 4k -S 0x78 0 4k' trunc_file > /dev/null
-xfs_io -F -f -c 'truncate 2k' trunc_file > /dev/null
-xfs_io -F -c 'pwrite 1k 0 1k' trunc_file > /dev/null
+$XFS_IO_PROG -f -c 'pwrite -b 4k -S 0x78 0 4k' trunc_file > /dev/null
+$XFS_IO_PROG -f -c 'truncate 2k' trunc_file > /dev/null
+$XFS_IO_PROG -c 'pwrite 1k 0 1k' trunc_file > /dev/null
_umount_mount
# create file, mmap a region and mmap read it
file=$SCRATCH_MNT/mmap
-xfs_io -F -f -c "pwrite 0 1024k" -c "mmap 64k 64k" -c "mread -r" $file > /dev/null
+$XFS_IO_PROG -f -c "pwrite 0 1024k" -c "mmap 64k 64k" -c "mread -r" $file > /dev/null
rm -f $file
touch $SCRATCH_MNT/testfile
echo "# appending 15k to new file, sync every 5k"
-xfs_io -F -a -c "pwrite 0 5k" -c "fsync" \
+$XFS_IO_PROG -a -c "pwrite 0 5k" -c "fsync" \
-c "pwrite 5k 5k" -c "fsync" \
-c "pwrite 10k 5k" -c "fsync" -c "stat" \
$SCRATCH_MNT/testfile \
|| _fail "mount failed: $MOUNT_OPTIONS"
echo "# stating file to confirm correct size"
-xfs_io -F -r -c "stat" $SCRATCH_MNT/testfile \
+$XFS_IO_PROG -r -c "stat" $SCRATCH_MNT/testfile \
| _show_wrote_and_stat_only
echo "# appending 10 bytes to new file, sync at 5 bytes"
-xfs_io -F -f -c "pwrite 0 5" -c s -c "pwrite 5 5" \
+$XFS_IO_PROG -f -c "pwrite 0 5" -c s -c "pwrite 5 5" \
-c "stat" $SCRATCH_MNT/nextfile \
| _show_wrote_and_stat_only
|| _fail "mount failed: $MOUNT_OPTIONS"
echo "# stating file to confirm correct size"
-xfs_io -F -r -c "stat" $SCRATCH_MNT/nextfile \
+$XFS_IO_PROG -r -c "stat" $SCRATCH_MNT/nextfile \
| _show_wrote_and_stat_only
# success, all done
[ "$avail" -ge 1049600 ] || _notrun "Test device is too small ($avail KiB)"
# reserve 1GiB, truncate at 100bytes
-$XFS_IO_PROG -F -f -c 'falloc 0 1g' -c 'truncate 100' $TEST_DIR/ouch
+$XFS_IO_PROG -f -c 'falloc 0 1g' -c 'truncate 100' $TEST_DIR/ouch
rm -f $TEST_DIR/ouch
# reserve 1GiB, truncate at 1GiB
-$XFS_IO_PROG -F -f -c 'falloc 0 1g' -c 'truncate 1g' $TEST_DIR/ouch
+$XFS_IO_PROG -f -c 'falloc 0 1g' -c 'truncate 1g' $TEST_DIR/ouch
rm -f $TEST_DIR/ouch
# reserve 1GiB, truncate at 2GiB
-$XFS_IO_PROG -F -f -c 'falloc 0 1g' -c 'truncate 2g' $TEST_DIR/ouch
+$XFS_IO_PROG -f -c 'falloc 0 1g' -c 'truncate 2g' $TEST_DIR/ouch
rm -f $TEST_DIR/ouch
# reserve 1GiB, 1GiB hole, reserve 1MiB, truncate at 3GiB
-$XFS_IO_PROG -F -f -c 'falloc 0 1g' -c 'falloc 2g 1m' -c 'truncate 3g' $TEST_DIR/ouch
+$XFS_IO_PROG -f -c 'falloc 0 1g' -c 'falloc 2g 1m' -c 'truncate 3g' $TEST_DIR/ouch
rm -f $TEST_DIR/ouch
# Try to reserve more space than we have
echo "Strangely, xfs_io sometimes says \"Success\" when something went wrong, FYI"
let toobig=$avail*2
-$XFS_IO_PROG -F -f -c "falloc 0 ${toobig}k" $TEST_DIR/ouch
+$XFS_IO_PROG -f -c "falloc 0 ${toobig}k" $TEST_DIR/ouch
rm -f $TEST_DIR/ouch
# success, all done
# Super-trivial; preallocate a region and read it; get 0s.
echo "=== falloc & read ==="
-$XFS_IO_PROG -F -f \
+$XFS_IO_PROG -f \
-c 'falloc 0 4096' \
-c 'pread -v 0 4096' \
$TEST_DIR/test214-1 | _filter_xfs_io_unique
# Should get no stale data. Early ext4 bug.
echo "=== falloc, write beginning, read ==="
-$XFS_IO_PROG -F -f \
+$XFS_IO_PROG -f \
-c 'falloc 0 512' \
-c 'pwrite 0 1' \
-c 'pread -v 0 512' \
# Same but write in the middle of the region
echo "=== falloc, write middle, read ==="
-$XFS_IO_PROG -F -f \
+$XFS_IO_PROG -f \
-c 'falloc 0 512' \
-c 'pwrite 256 1' \
-c 'pread -v 0 512' \
# Same but write the end of the region
echo "=== falloc, write end, read ==="
-$XFS_IO_PROG -F -f \
+$XFS_IO_PROG -f \
-c 'falloc 0 512' \
-c 'pwrite 511 1' \
-c 'pread -v 0 512' \
echo "=== falloc, write, sync, truncate, read ==="
# Allocate, write, sync, truncate (buffered)
-$XFS_IO_PROG -F -f \
+$XFS_IO_PROG -f \
-c 'falloc 0x0 0x65C00' \
-c 'pwrite -S 0xAA 0x12000 0x10000' \
-c 'fsync' \
$TEST_DIR/test214-5 | _filter_xfs_io_unique
# now do a direct read and see what's on-disk
-$XFS_IO_PROG -F -f -d \
+$XFS_IO_PROG -f -d \
-c 'pread -v 0 0x16000' \
$TEST_DIR/test214-5 | _filter_xfs_io_unique
# delalloc write 16k, fallocate same range.
# Should get caught on fsck when we're done.
-$XFS_IO_PROG -F -f \
+$XFS_IO_PROG -f \
-c "pwrite 0 16k" \
-c "falloc 0 16k" \
-c "fsync" \
echo "=== ext4 testcase 2 ==="
-$XFS_IO_PROG -F -f \
- -c "fsync" \
+$XFS_IO_PROG -f \
+ -c "fsync" \
-c "pwrite 551917 41182" \
-c "falloc 917633 392230" \
-c "pwrite 285771 77718" \
echo
echo "writing via mmap"
-$XFS_IO_PROG -F -f \
+$XFS_IO_PROG -f \
-c 'mmap 0 4096' \
-c 'mwrite 0 4096' \
$testfile | _filter_xfs_io_unique
echo "--- initiating parallel IO..." >>$seqres.full
# Small ios here because ext3 will account for indirect blocks too ...
# 48k will fit w/o indirect for 4k blocks (default blocksize)
- $XFS_IO_PROG -F -c 'pwrite 0 48k' -c 'fsync' \
+ $XFS_IO_PROG -c 'pwrite 0 48k' -c 'fsync' \
$SCRATCH_MNT/buffer >>$seqres.full 2>&1 &
- $XFS_IO_PROG -F -c 'pwrite 0 48k' -d \
+ $XFS_IO_PROG -c 'pwrite 0 48k' -d \
$SCRATCH_MNT/direct >>$seqres.full 2>&1 &
- $XFS_IO_PROG -F -c 't 48k' -c 'mm -rw 0 48k' -c 'mw 0 48k' -c 'ms -s' \
+ $XFS_IO_PROG -c 't 48k' -c 'mm -rw 0 48k' -c 'mw 0 48k' -c 'ms -s' \
$SCRATCH_MNT/mmap >>$seqres.full 2>&1 &
wait
echo "--- completed parallel IO ($type)" >>$seqres.full
echo "=== Testing size ${SIZE_MULT}*${SUNIT_K}k on ${SUNIT_K}k stripe ==="
for FILE in 1 2 3 4; do
- xfs_io -F -f -c "falloc 0 $SIZE" \
+ $XFS_IO_PROG -f -c "falloc 0 $SIZE" \
$SCRATCH_MNT/file-$FILE-$SIZE-falloc \
>> $seqres.full 2>&1
- xfs_io -F -f -c "pwrite 0 $SIZE" \
+ $XFS_IO_PROG -f -c "pwrite 0 $SIZE" \
$SCRATCH_MNT/file-$FILE-$SIZE-write \
>> $seqres.full 2>&1
src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-falloc \
done
echo "=== Testing size 1g falloc on ${SUNIT_K}k stripe ==="
- xfs_io -F -f -c "falloc 0 1g" \
+ $XFS_IO_PROG -f -c "falloc 0 1g" \
$SCRATCH_MNT/file-1g-falloc >> $seqres.full 2>&1
src/t_stripealign $SCRATCH_MNT/file-1g-falloc $SUNIT_BLOCKS \
| _filter_scratch
rm -f $SCRATCH_MNT/file-1g-falloc | _filter_scratch
echo "=== Testing size 1073745920 falloc on ${SUNIT_K}k stripe ==="
- xfs_io -F -f -c "falloc 0 1073745920" \
+ $XFS_IO_PROG -f -c "falloc 0 1073745920" \
$SCRATCH_MNT/file-1073745920-falloc >> $seqres.full 2>&1
src/t_stripealign $SCRATCH_MNT/file-1073745920-falloc \
$SUNIT_BLOCKS | _filter_scratch
echo "--> $loops buffered 64m writes in a loop"
for I in `seq 1 $loops`; do
echo -n "$I "
- xfs_io -F -f \
+ $XFS_IO_PROG -f \
-c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
rm -f $SCRATCH_MNT/test
done
echo "--> $loops direct 64m writes in a loop"
for I in `seq 1 $loops`; do
echo -n "$I "
- xfs_io -F -f -d \
+ $XFS_IO_PROG -f -d \
-c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
rm -f $SCRATCH_MNT/test
done
echo "File size limit is now set to 100 MB."
echo "Let us try to preallocate 101 MB. This should fail."
-$XFS_IO_PROG -F -f -c 'falloc 0 101m' $TEST_DIR/ouch
+$XFS_IO_PROG -f -c 'falloc 0 101m' $TEST_DIR/ouch
rm -f $TEST_DIR/ouch
echo "Let us now try to preallocate 50 MB. This should succeed."
-$XFS_IO_PROG -F -f -c 'falloc 0 50m' $TEST_DIR/ouch
+$XFS_IO_PROG -f -c 'falloc 0 50m' $TEST_DIR/ouch
rm -f $TEST_DIR/ouch
echo "Test over."
echo "--- initiating IO..." >>$seqres.full
# Firstly fit below block soft limit
echo "Write 900k..."
- su $qa_user -c "$XFS_IO_PROG -F -c 'pwrite 0 900k' -c fsync \
+ su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 900k' -c fsync \
$SCRATCH_MNT/file1" 2>&1 >>$seqres.full | tee -a $seqres.full
repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1
# Secondly overcome block soft limit
echo "Rewrite 1001k..."
- su $qa_user -c "$XFS_IO_PROG -F -c 'pwrite 0 1001k' -c fsync \
+ su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 1001k' -c fsync \
$SCRATCH_MNT/file1" 2>&1 >>$seqres.full | tee -a $seqres.full
repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1
# Now try to overcome block hardlimit
echo "Write 1000k..."
- su $qa_user -c "$XFS_IO_PROG -F -c 'pwrite 0 1000k' -c fsync \
+ su $qa_user -c "$XFS_IO_PROG -c 'pwrite 0 1000k' -c fsync \
$SCRATCH_MNT/file2" 2>&1 >>$seqres.full | tee -a $seqres.full
repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1
# Now sleep for grace time and check that softlimit got enforced
sleep $((grace+1))
echo "Write 4096..."
- su $qa_user -c "$XFS_IO_PROG -F -c 'truncate 0' -c 'pwrite 0 4096' \
+ su $qa_user -c "$XFS_IO_PROG -c 'truncate 0' -c 'pwrite 0 4096' \
$SCRATCH_MNT/file2" 2>&1 >>$seqres.full | tee -a $seqres.full
repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seqres.full 2>&1
# And now the softlimit test for inodes
wait
return 1
fi
- $XFS_IO_PROG -F -c 'fsync' $SCRATCH_MNT/fsx_file$i
+ $XFS_IO_PROG -c 'fsync' $SCRATCH_MNT/fsx_file$i
cat $tmp.output$i | tee -a $seqres.full
done
return 0
touch $SCRATCH_MNT/failed 2>&1 | tee -a $seqres.full | _filter_scratch
mount -o remount,rw $SCRATCH_DEV 2>&1 | tee -a $seqres.full | _filter_scratch
-$XFS_IO_PROG -F -c 'pwrite 0 8k' -c 'fsync' \
+$XFS_IO_PROG -c 'pwrite 0 8k' -c 'fsync' \
$SCRATCH_MNT/testfile >>$seqres.full 2>&1
repquota -u -g $SCRATCH_MNT | grep -v "^root" | _filter_scratch
for i in `seq $start -1 0`
do
offset=`expr $i \* $iosize`
- $XFS_IO_PROG -F -f -c "mmap -w $offset $iosize" -c "mwrite $offset $iosize" $testfile
+ $XFS_IO_PROG -f -c "mmap -w $offset $iosize" -c "mwrite $offset $iosize" $testfile
[ $? -ne 0 ] && exit
done
DST=$TEST_DIR/$seq.dst
rm -f $seqres.full
-$XFS_IO_PROG -F -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC >> $seqres.full 2>&1
+$XFS_IO_PROG -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC >> $seqres.full 2>&1
[ $? -ne 0 ] && _fail "xfs_io pwrite failed"
-$XFS_IO_PROG -F -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST >> $seqres.full 2>&1
+$XFS_IO_PROG -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST >> $seqres.full 2>&1
[ $? -ne 0 ] && _fail "xfs_io sendfile failed"
diff -q $SRC $DST
testfile=$TEST_DIR/255.$$
# Standard punch hole tests
-_test_generic_punch falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
+_test_generic_punch falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile
# Delayed allocation punch hole tests
-_test_generic_punch -d falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
+_test_generic_punch -d falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile
# Multi hole punch tests
-_test_generic_punch -k falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
+_test_generic_punch -k falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile
# Delayed allocation multi punch hole tests
-_test_generic_punch -d -k falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile -F
+_test_generic_punch -d -k falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile
status=0 ; exit
while [ $file_size -ge $block_size ]
do
bytes_written=0
- _user_do "$XFS_IO_PROG -F -f -c \"pwrite 0 $file_size\" $dir/$file_count.bin &> /dev/null"
+ _user_do "$XFS_IO_PROG -f -c \"pwrite 0 $file_size\" $dir/$file_count.bin &> /dev/null"
if [ -f $dir/$file_count.bin ]
then
- bytes_written=`$XFS_IO_PROG -F -c "stat" $dir/$file_count.bin | grep stat.size | cut -d ' ' -f3`
+ bytes_written=`$XFS_IO_PROG -c "stat" $dir/$file_count.bin | grep stat.size | cut -d ' ' -f3`
fi
# If there was no room to make the file,
rm -f $file_name &> /dev/null
- $XFS_IO_PROG -F -f -c "pwrite 0 $file_len" \
+ $XFS_IO_PROG -f -c "pwrite 0 $file_len" \
-c "fsync" $file_name &> /dev/null
chmod 666 $file_name
do
# This part must not be done as root in order to
# test that reserved blocks are used when needed
- _user_do "$XFS_IO_PROG -F -f -c \"fpunch $hole_offset $hole_len\" $file_name"
+ _user_do "$XFS_IO_PROG -f -c \"fpunch $hole_offset $hole_len\" $file_name"
rc=$?
if [ $? -ne 0 ] ; then
echo Punch hole failed
_scratch_mount
# Create a 4k file and Allocate 4M past EOF on that file
-xfs_io -F -f -c "pwrite 0 4k" -c "falloc -k 4k 4m" $SCRATCH_MNT/test \
+$XFS_IO_PROG -f -c "pwrite 0 4k" -c "falloc -k 4k 4m" $SCRATCH_MNT/test \
>>$seqres.full 2>&1 || _fail "failed to create test file"
# Fill the rest of the fs completely
done
echo "*** test01() create sparse file ***" >>$seqres.full
- eval ${XFS_IO_PROG} -F -f "${write_cmd}" $src >>$seqres.full 2>&1 ||
+ eval ${XFS_IO_PROG} -f "${write_cmd}" $src >>$seqres.full 2>&1 ||
_fail "create sparse file failed!"
echo "*** test01() create sparse file done ***" >>$seqres.full
echo >>$seqres.full
done
echo "*** test02() create sparse file ***" >>$seqres.full
- eval ${XFS_IO_PROG} -F -f "${write_cmd}" $src >>$seqres.full 2>&1 ||
+ eval ${XFS_IO_PROG} -f "${write_cmd}" $src >>$seqres.full 2>&1 ||
_fail "create sparse file failed!"
echo "*** test02() create sparse file done ***" >>$seqres.full
echo >>$seqres.full
done
echo "*** test03() create sparse file ***" >>$seqres.full
- eval ${XFS_IO_PROG} -F -f "${write_cmd}" $src >>$seqres.full 2>&1 ||
+ eval ${XFS_IO_PROG} -f "${write_cmd}" $src >>$seqres.full 2>&1 ||
_fail "create sparse file failed!"
echo "*** test03() create sparse file done ***" >>$seqres.full
echo >>$seqres.full
done
echo "*** test04() create sparse file ***" >>$seqres.full
- eval ${XFS_IO_PROG} -F -f "${write_cmd}" $src >>$seqres.full 2>&1 ||
+ eval ${XFS_IO_PROG} -f "${write_cmd}" $src >>$seqres.full 2>&1 ||
_fail "create sparse file failed!"
echo "*** test04() create sparse file done ***" >>$seqres.full
echo >>$seqres.full
echo "== try to create new file"
touch $SCRATCH_MNT/this_should_fail 2>&1 | _filter_scratch
echo "== pwrite to null device"
-$XFS_IO_PROG -F -c "pwrite 0 512" $DEVNULL | _filter_xfs_io
+$XFS_IO_PROG -c "pwrite 0 512" $DEVNULL | _filter_xfs_io
echo "== pread from zero device"
-$XFS_IO_PROG -F -c "pread 0 512" $DEVZERO | _filter_xfs_io
+$XFS_IO_PROG -c "pread 0 512" $DEVZERO | _filter_xfs_io
echo "== truncating write to null device"
echo foo > $DEVNULL 2>&1 | _filter_scratch
echo "== writing to symlink from ro fs to rw fs"
# Various combinations of O_CREAT & O_TRUNC
-$XFS_IO_PROG -F -c "pwrite 0 512" $SYMLINK | _filter_xfs_io
-$XFS_IO_PROG -F -f -c "pwrite 0 512" $SYMLINK | _filter_xfs_io
-$XFS_IO_PROG -F -t -c "pwrite 0 512" $SYMLINK | _filter_xfs_io
+$XFS_IO_PROG -c "pwrite 0 512" $SYMLINK | _filter_xfs_io
+$XFS_IO_PROG -f -c "pwrite 0 512" $SYMLINK | _filter_xfs_io
+$XFS_IO_PROG -t -c "pwrite 0 512" $SYMLINK | _filter_xfs_io
echo "== write to bind-mounted rw file on ro fs"
mount --bind $TARGET $BINDFILE
# with and without -f (adds O_CREAT)
-$XFS_IO_PROG -F -c "pwrite 0 512" $BINDFILE | _filter_xfs_io
-$XFS_IO_PROG -F -f -c "pwrite 0 512" $BINDFILE | _filter_xfs_io
-$XFS_IO_PROG -F -t -c "pwrite 0 512" $BINDFILE | _filter_xfs_io
+$XFS_IO_PROG -c "pwrite 0 512" $BINDFILE | _filter_xfs_io
+$XFS_IO_PROG -f -c "pwrite 0 512" $BINDFILE | _filter_xfs_io
+$XFS_IO_PROG -t -c "pwrite 0 512" $BINDFILE | _filter_xfs_io
# success, all done
status=0
_defrag $fragfile
echo "Sparse file (no blocks):" | tee -a $seqres.full
-xfs_io -F -f -c "truncate 1m" $fragfile
+$XFS_IO_PROG -f -c "truncate 1m" $fragfile
_defrag $fragfile
echo "Contiguous file:" | tee -a $seqres.full
# Begin test cases.
echo "Test 1: Fallocate 40960 bytes and write 4096 bytes (buffered io)." \
>> $seqres.full
-${XFS_IO_PROG} -F -f \
+${XFS_IO_PROG} -f \
-c 'falloc -k 0 40960' \
-c 'pwrite 0 4096' \
${TEST_DIR}/test_1 | _filter_xfs_io_unique
echo "Test 2: Fallocate 40960 bytes and write 4096 bytes (direct io)." \
>> $seqres.full
-${XFS_IO_PROG} -F -f -d \
+${XFS_IO_PROG} -f -d \
-c 'falloc -k 0 40960' \
-c 'pwrite 0 4096' \
${TEST_DIR}/test_2 | _filter_xfs_io_unique
echo "Test 3: Fallocate 40960 bytes and write 40960 bytes (buffered io)." \
>> $seqres.full
-${XFS_IO_PROG} -F -f \
+${XFS_IO_PROG} -f \
-c 'falloc -k 0 40960' \
-c 'pwrite 0 40960' \
${TEST_DIR}/test_3 | _filter_xfs_io_unique
echo "Test 4: Fallocate 40960 bytes and write 40960 bytes (direct io)." \
>> $seqres.full
-${XFS_IO_PROG} -F -f -d \
+${XFS_IO_PROG} -f -d \
-c 'falloc -k 0 40960' \
-c 'pwrite 0 40960' \
${TEST_DIR}/test_4 | _filter_xfs_io_unique
echo "Test 5: Fallocate 128k, seek 256k and write 4k block (buffered io)." \
>> $seqres.full
-${XFS_IO_PROG} -F -f \
+${XFS_IO_PROG} -f \
-c 'falloc -k 0 128k' \
-c 'pwrite 256k 4k' \
${TEST_DIR}/test_5 | _filter_xfs_io_unique
echo "Test 6: Fallocate 128k, seek to 256k and write a 4k block (direct io)." \
>> $seqres.full
-${XFS_IO_PROG} -F -f -d \
+${XFS_IO_PROG} -f -d \
-c 'falloc -k 0 128k' \
-c 'pwrite 256k 4k' \
${TEST_DIR}/test_6 | _filter_xfs_io_unique
testfile=$TEST_DIR/252.$$
# Standard punch hole tests
-_test_generic_punch falloc fpunch fpunch fiemap _filter_fiemap $testfile -F
+_test_generic_punch falloc fpunch fpunch fiemap _filter_fiemap $testfile
# Delayed allocation punch hole tests
-_test_generic_punch -d falloc fpunch fpunch fiemap _filter_fiemap $testfile -F
+_test_generic_punch -d falloc fpunch fpunch fiemap _filter_fiemap $testfile
# Multi hole punch tests
-_test_generic_punch -k falloc fpunch fpunch fiemap _filter_fiemap $testfile -F
+_test_generic_punch -k falloc fpunch fpunch fiemap _filter_fiemap $testfile
# Delayed allocation multi punch hole tests
-_test_generic_punch -d -k falloc fpunch fpunch fiemap _filter_fiemap $testfile -F
+_test_generic_punch -d -k falloc fpunch fpunch fiemap _filter_fiemap $testfile
status=0 ; exit