[Top] [All Lists]

[PATCH] generic: add fallocate() checks to generic/300

To: xfs@xxxxxxxxxxx
Subject: [PATCH] generic: add fallocate() checks to generic/300
From: Eric Whitney <enwlinux@xxxxxxxxx>
Date: Fri, 11 Apr 2014 17:43:07 -0400
Cc: linux-ext4@xxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=9IU8L1iUU6+abJjtmwKJzVoBnqZ500yUoBXBjIVm6qE=; b=uLiYvbYW7GyH4GdbsKAgO+B3aP12gpLktgd8KZVltPJc4E+hHpthjH/RZ6weJoZgO3 zYgJ7P+RqP/Um4fCC0uMxQ3Ix6EscnqJHUX9XLBsS3vPyCLyiSwxuLWziZSELkOkCpvg Kk9OzyfOHDRHesULSeoRlx26WGTTGaBoVb8aWwib54GauHET58lwkA39+5SRTqvnDdI7 HHPlkH0gLFvwpFMd+vNnzikGLvQO4c58HoL7HsmE0fuNnnb3jOo6hCXrdRPURdNuNx/J BG5PSVk1akFgCd2t0ySeCiPdzvZky0z+9eCy7dgJoeAHjLm5ISMzzcuLTOS/e1RYw9ax mUZg==
User-agent: Mutt/1.5.21 (2010-09-15)
Generic/300 fails when run on a test filesystem that does not support
fallocate(). It uses fio's falloc ioengine to generate part of its I/O
load and both allocates blocks and punches holes.  This causes EOPNOTSUPP
failures when the test is run on indirect block-mapped ext4 filesystems
or pre-3.14 ext4 filesystems created with bigalloc.

Verify that the test filesystem supports fallocate() before proceeding
with the test, checking for both block allocation and hole punching
capabilities.  Also, delete any pre-existing test output.

Signed-off-by: Eric Whitney <enwlinux@xxxxxxxxx>
 tests/generic/300 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/generic/300 b/tests/generic/300
index 7c60728..4e07f8a 100755
--- a/tests/generic/300
+++ b/tests/generic/300
@@ -44,6 +44,13 @@ _supported_os Linux
+# xfs_io is not required for this test, but it's the best way to verify
+# the test system supports fallocate() for allocation and hole punching
+rm -f $seqres.full
 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
 if [ $((BLK_DEV_SIZE)) -gt 1048576 ]

<Prev in Thread] Current Thread [Next in Thread>