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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux