linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfstests: fsx: fix the hole punching test
@ 2011-08-08 15:58 Josef Bacik
  2011-08-09 10:08 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2011-08-08 15:58 UTC (permalink / raw)
  To: linux-fsdevel, xfs

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@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfstests: fsx: fix the hole punching test
  2011-08-08 15:58 [PATCH] xfstests: fsx: fix the hole punching test Josef Bacik
@ 2011-08-09 10:08 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2011-08-09 10:08 UTC (permalink / raw)
  To: Josef Bacik; +Cc: linux-fsdevel, xfs

On Mon, Aug 08, 2011 at 11:58:00AM -0400, Josef Bacik wrote:
> 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@redhat.com>

Already fixed:

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

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-09 10:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-08 15:58 [PATCH] xfstests: fsx: fix the hole punching test Josef Bacik
2011-08-09 10:08 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).