From: Eric Sandeen <sandeen@redhat.com>
To: fstests@vger.kernel.org
Subject: [PATCH] use xfs_io falloc, not fallocate
Date: Thu, 13 Nov 2014 17:51:24 -0600 [thread overview]
Message-ID: <546543FC.6020701@redhat.com> (raw)
generic/315 fails messily if the fallocate command
isn't present.
generic/299 also uses "fallocate" and "truncate"
binaries which may not be present.
Switch both to use xfs_io, and we already have the
_require for that, because it's what every other test
uses...
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/tests/generic/299 b/tests/generic/299
index e8685a4..f4fc20e 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -110,6 +110,7 @@ filename=buffered-aio-verifier
EOF
_require_fio $fio_config
+_require_xfs_io_command "falloc"
_workout()
{
@@ -125,12 +126,13 @@ _workout()
do
for ((k=1; k <= NUM_JOBS; k++))
do
- fallocate -l $FILE_SIZE $SCRATCH_MNT/direct_aio.$k.0 \
- >> $seqres.full 2>&1
+ $XFS_IO_PROG -f -c "falloc 0 $FILE_SIZE" \
+ $SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
done
for ((k=1; k <= NUM_JOBS; k++))
do
- truncate -s 0 $SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
+ $XFS_IO_PROG -c "truncate 0" \
+ $SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
done
# Following like will check that pid is still run.
# Once fio exit we can stop fallocate/truncate loop
diff --git a/tests/generic/315 b/tests/generic/315
index 62fdc01..4433b6c 100755
--- a/tests/generic/315
+++ b/tests/generic/315
@@ -49,6 +49,7 @@ _cleanup()
_supported_fs generic
_supported_os Linux
_require_test
+_require_xfs_io_command "falloc"
rm -f $seqres.full
@@ -62,7 +63,8 @@ avail_begin=`df -P $TEST_DIR | awk 'END {print $4}'`
# Preallocate half size of the available disk space to a file
# starts from offset 0 with FALLOC_FL_KEEP_SIZE option on the
# test file system.
-fallocate -n -o 0 -l $(($avail_begin/2)) $TEST_DIR/testfile.$seq >>$seqres.full 2>&1
+$XFS_IO_PROG -f -c 'falloc -k 0 $(($avail_begin/2))' \
+ $TEST_DIR/testfile.$seq >>$seqres.full 2>&1
# Verify the file size, it should keep unchanged as 0 in this case
fsize=`ls -l $TEST_DIR/testfile.$seq | awk '{print $5}'`
reply other threads:[~2014-11-13 23:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=546543FC.6020701@redhat.com \
--to=sandeen@redhat.com \
--cc=fstests@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.