xfs
[Top] [All Lists]

[PATCH] xfstests: fsx: fix the hole punching test

To: linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Subject: [PATCH] xfstests: fsx: fix the hole punching test
From: Josef Bacik <josef@xxxxxxxxxx>
Date: Mon, 8 Aug 2011 11:58:00 -0400
The test to make sure we support hole punching is just wrong.  First it passes
the mode options into the len argument, and secondly it uses 0 for what I assume
was meant for the length, which doesn't work right.  Also it uses warn instead
of just normal prt, which will cause xfstests to blow up for no reason.  So fix
the arguments and the error message so that we can actually run xfstests with
fsx on fs's that don't support hole punching yet.  Thanks,

Signed-off-by: Josef Bacik <josef@xxxxxxxxxx>
---
 ltp/fsx.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/ltp/fsx.c b/ltp/fsx.c
index 662af38..692ad58 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -1261,11 +1261,10 @@ test_punch_hole()
 {
 #ifdef FALLOC_FL_PUNCH_HOLE
        if (!lite && punch_hole_calls) {
-               if (fallocate(fd, 0, 0,
-                       FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE) &&
-                       errno == EOPNOTSUPP) {
-
-                       warn("main: filesystem does not support fallocate punch 
hole, disabling");
+               if (fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, 
0, 1) &&
+                   errno == EOPNOTSUPP) {
+                       if (!quiet)
+                               prt("main: filesystem does not support 
fallocate punch hole, disabling\n");
                        punch_hole_calls = 0;
                }
        }
-- 
1.7.5.2

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