]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic: require filesize to be greater than fs block size in
authorStanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Wed, 11 Dec 2013 11:21:28 +0000 (11:21 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 11 Dec 2013 15:05:54 +0000 (09:05 -0600)
 generic/240
Date: Wed, 11 Dec 2013 11:21:28 -0000
From: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>

If we execute generic/240 on a fs which has its fs block size greater
than 64k (for example, NFS), this test will fail with:

  io_submit failed: Invalid argument

This will happen because in src/aio-dio-regress/aiodio_sparse2.c this
expression

  num_aio = filesize / step;

will set num_aio to 0 and this means that no io_prep_write() will happen
before calling io_submit().

Fixing filesize to be 8 * "fs block size".

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
tests/generic/240

index e26f49512d78dc726276ad3075d6bc3c4825ae7b..74dbba67a27a094d96d6493ed4fc54654a1ed055 100755 (executable)
@@ -62,14 +62,15 @@ rm -f $TEST_DIR/aiodio_sparse
 
 logical_block_size=`_min_dio_alignment $TEST_DEV`
 fs_block_size=`stat -f $TEST_DIR | grep "Block size:" | awk '{print $3}'`
+file_size=$((8 * $fs_block_size))
 
 if [ $fs_block_size -le $logical_block_size ]; then
        _notrun "fs block size must be larger than the device block size.  fs block size: $fs_block_size, device block size: $logical_block_size"
 fi
 
-# 2 threads, fs block sized writes, 64k filesize, stride through file by
+# 2 threads, fs block sized writes, filesize, stride through file by
 # fs block size, start at logical block size offset
-$AIO_TEST -i 2 -w $fs_block_size -s 64k -n $fs_block_size -o $logical_block_size "$TEST_DIR/aiodio_sparse"
+$AIO_TEST -i 2 -w $fs_block_size -s $file_size -n $fs_block_size -o $logical_block_size "$TEST_DIR/aiodio_sparse"
 
 status=$?
 exit