xfs
[Top] [All Lists]

[PATCH 2/8] Fix fallocate() test

To: xfs@xxxxxxxxxxx
Subject: [PATCH 2/8] Fix fallocate() test
From: Jan Kara <jack@xxxxxxx>
Date: Mon, 24 May 2010 16:14:13 +0200
Cc: hch@xxxxxxxxxxxxx, david@xxxxxxxxxxxxx, Jan Kara <jack@xxxxxxx>
In-reply-to: <1274710459-11446-1-git-send-email-jack@xxxxxxx>
References: <1274710459-11446-1-git-send-email-jack@xxxxxxx>
The test for fallocate was broken because it used $TEST_DIR/$tmp.io. Because
$tmp is usually something like /tmp/1234 or /mnt/1234 the file cannot be
created and xfs_io fails regardless of existance of fallocate support. Moreover
the subsequent message parsing decides that fallocate is actually supported
because it does not expect this message.

Fix the test to not use $tmp.

Signed-off-by: Jan Kara <jack@xxxxxxx>
---
 common.rc |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common.rc b/common.rc
index e6d818d..6bf1e12 100644
--- a/common.rc
+++ b/common.rc
@@ -803,8 +803,9 @@ _require_user()
 #
 _require_xfs_io_falloc()
 {
-       testio=`$XFS_IO_PROG -F -f -c "falloc 0 1m" $TEST_DIR/$tmp.io 2>&1`
-       rm -f $TEST_DIR/$tmp.io 2>&1 > /dev/null
+       testfile=$TEST_DIR/$$.falloc
+       testio=`$XFS_IO_PROG -F -f -c "falloc 0 1m" $testfile 2>&1`
+       rm -f $testfile 2>&1 > /dev/null
        echo $testio | grep -q "not found" && \
                _notrun "xfs_io fallocate support is missing"
        echo $testio | grep -q "Operation not supported" && \
-- 
1.6.4.2

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