linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com
Subject: [PATCH] xfstests: fsx: fix the hole punching test
Date: Mon,  8 Aug 2011 11:58:00 -0400	[thread overview]
Message-ID: <1312819080-10083-1-git-send-email-josef@redhat.com> (raw)

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


             reply	other threads:[~2011-08-08 15:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 15:58 Josef Bacik [this message]
2011-08-09 10:08 ` [PATCH] xfstests: fsx: fix the hole punching test Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312819080-10083-1-git-send-email-josef@redhat.com \
    --to=josef@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).