public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/4] xfstests: fix fsx fpunch test to actually test for fpunch
Date: Mon, 27 Jun 2011 15:45:19 -0500	[thread overview]
Message-ID: <4E08EBDF.40904@sandeen.net> (raw)
In-Reply-To: <1309153722-1231-2-git-send-email-david@fromorbit.com>

On 6/27/11 12:48 AM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> The operation flags parameter to fallocate is the second parameter,
> not the last. Hence the fpunch test is actually testing for falloc
> support, not fpunch. Somebody needs a brown paper bag.
> 
> Also, add a ftruncate call whenthe fpunch succeeds just in case the
> file was not already zero sized. Failing to ensure we start with a
> zero length file can cause read ops to fail size checks if they
> occur before the file is written to be the main test loop.
> 
> While there, observe the quiet flag the same as the falloc test
> does and have them both emit the warning at the same error level.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

> ---
>  ltp/fsx.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/ltp/fsx.c b/ltp/fsx.c
> index 0683853..a37e223 100644
> --- a/ltp/fsx.c
> +++ b/ltp/fsx.c
> @@ -1243,7 +1243,7 @@ test_fallocate()
>  	if (!lite && fallocate_calls) {
>  		if (fallocate(fd, 0, 0, 1) && errno == EOPNOTSUPP) {
>  			if(!quiet)
> -				prt("fsx: main: filesystem does not support fallocate, disabling\n");
> +				warn("main: filesystem does not support fallocate, disabling\n");
>  			fallocate_calls = 0;
>  		} else {
>  			ftruncate(fd, 0);
> @@ -1260,13 +1260,13 @@ 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_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> +				0, 1) && errno == EOPNOTSUPP) {
> +			if(!quiet)
> +				warn("main: filesystem does not support fallocate punch hole, disabling");
>  			punch_hole_calls = 0;
> -		}
> +		} else
> +			ftruncate(fd, 0);
>  	}
>  #else /* ! PUNCH HOLE */
>  	punch_hole_calls = 0;

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2011-06-27 20:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27  5:48 ***** SUSPECTED SPAM ***** [PATCH 0/4] xfstests: fsx is fallocate challenged Dave Chinner
2011-06-27  5:48 ` [PATCH 1/4] xfstests: fix fsx fpunch test to actually test for fpunch Dave Chinner
2011-06-27 18:15   ` Allison Henderson
2011-06-27 20:45   ` Eric Sandeen [this message]
2011-06-27  5:48 ` [PATCH 2/4] xfstests: fsx fallocate support is b0rked Dave Chinner
2011-06-27 21:16   ` Eric Sandeen
2011-06-27 23:07     ` Dave Chinner
2011-06-27  5:48 ` [PATCH 3/4] xfstests: fix brain-o in fallocate log dump Dave Chinner
2011-06-27 21:32   ` Eric Sandeen
2011-06-27  5:48 ` [PATCH 4/4] xfstests: add mapped write fsx operations to 091 Dave Chinner
2011-06-27 21:38   ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2011-07-08  0:53 [PATCH 0/4, V2] xfstests: fsx is fallocate challenged Dave Chinner
2011-07-08  0:53 ` [PATCH 1/4] xfstests: fix fsx fpunch test to actually test for fpunch Dave Chinner
2011-07-08 17:56   ` Alex Elder

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=4E08EBDF.40904@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=david@fromorbit.com \
    --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