Skip to contentSkip to conversation

xfstests: fsx: fix the hole punching test

PATCH In review Josef Bacik 2 participants 2 messages Aug 8, 2011 – Aug 9, 2011 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: fsx: fix the hole punching test

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,

---
 ltp/fsx.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
ltp/fsx.c +4 -5
index 662af38..692ad58 100644
@@ -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;
 		}
 	}
Signature · 1 line
1.7.5.2
#1 lore raw
Quoted 8 lines · Josef Bacik

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,

Already fixed:

http://git.kernel.org/?p=fs/xfs/xfstests-dev.git;a=commit;h=c18bf42de9d5d5fa05025754df1ff63f2147bd12

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]