All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs-oss <xfs@oss.sgi.com>, ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] xfstests: fix seek_sanity_test for fs w/o fallocate
Date: Sat, 1 Jun 2013 01:24:56 +0800	[thread overview]
Message-ID: <20130531172456.GB6915@gmail.com> (raw)
In-Reply-To: <51A8C59B.3030308@redhat.com>

On Fri, May 31, 2013 at 10:45:31AM -0500, Eric Sandeen wrote:
> currently the seek_sanity_test (generic/285) fails on ext3
> or ext2 due to fallocate() failures.  Just ignore that test
> if the fs doesn't support fallocate.

Hi Eric,

I remember that my patch had been applied [1].  But stranger I couldn't
find it in xfstests tree.  However, I think that your patch is better.

1. http://oss.sgi.com/archives/xfs/2013-05/msg00534.html

                                                - Zheng

> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c
> index cd3b1ee..fbf5a8c 100644
> --- a/src/seek_sanity_test.c
> +++ b/src/seek_sanity_test.c
> @@ -96,9 +96,13 @@ static int do_fallocate(int fd, off_t offset, off_t length, int mode)
>  	int ret;
>  
>  	ret = fallocate(fd, mode, offset, length);
> -	if (ret)
> +	if (ret) {
> +		/* Don't warn about a filesystem w/o fallocate support */
> +		if (errno == EOPNOTSUPP)
> +			return ret;
>  		fprintf(stderr, "  ERROR %d: Failed to preallocate "
>  			"space to %ld bytes\n", errno, (long) length);
> +	}
>  
>  	return ret;
>  }
> @@ -290,8 +294,14 @@ static int test09(int fd, int testnum)
>  
>  	/* preallocate 8M space to file */
>  	ret = do_fallocate(fd, 0, filsz, 0);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		/* Report success if fs doesn't support fallocate */
> +		if (errno == EOPNOTSUPP) {
> +			fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n");
> +			ret = 0;
> +		}
>  		goto out;
> +	}
>  
>  	ret = do_pwrite(fd, buf, bufsz, bufsz * 10);
>  	if (!ret) {
> @@ -336,8 +346,14 @@ static int test08(int fd, int testnum)
>  
>  	/* preallocate 4M space to file */
>  	ret = do_fallocate(fd, 0, filsz, 0);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		/* Report success if fs doesn't support fallocate */
> +		if (errno == EOPNOTSUPP) {
> +			fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n");
> +			ret = 0;
> +		}
>  		goto out;
> +	}
>  
>  	ret = do_pwrite(fd, buf, bufsz, bufsz * 10);
>  	if (ret)
> @@ -379,8 +395,14 @@ static int test07(int fd, int testnum)
>  
>  	/* preallocate 4M space to file */
>  	ret = do_fallocate(fd, 0, filsz, 0);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		/* Report success if fs doesn't support fallocate */
> +		if (errno == EOPNOTSUPP) {
> +			fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n");
> +			ret = 0;
> +		}
>  		goto out;
> +	}
>  
>  	ret = do_pwrite(fd, buf, bufsz, bufsz * 10);
>  	if (ret)
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

WARNING: multiple messages have this Message-ID (diff)
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfstests: fix seek_sanity_test for fs w/o fallocate
Date: Sat, 1 Jun 2013 01:24:56 +0800	[thread overview]
Message-ID: <20130531172456.GB6915@gmail.com> (raw)
In-Reply-To: <51A8C59B.3030308@redhat.com>

On Fri, May 31, 2013 at 10:45:31AM -0500, Eric Sandeen wrote:
> currently the seek_sanity_test (generic/285) fails on ext3
> or ext2 due to fallocate() failures.  Just ignore that test
> if the fs doesn't support fallocate.

Hi Eric,

I remember that my patch had been applied [1].  But stranger I couldn't
find it in xfstests tree.  However, I think that your patch is better.

1. http://oss.sgi.com/archives/xfs/2013-05/msg00534.html

                                                - Zheng

> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c
> index cd3b1ee..fbf5a8c 100644
> --- a/src/seek_sanity_test.c
> +++ b/src/seek_sanity_test.c
> @@ -96,9 +96,13 @@ static int do_fallocate(int fd, off_t offset, off_t length, int mode)
>  	int ret;
>  
>  	ret = fallocate(fd, mode, offset, length);
> -	if (ret)
> +	if (ret) {
> +		/* Don't warn about a filesystem w/o fallocate support */
> +		if (errno == EOPNOTSUPP)
> +			return ret;
>  		fprintf(stderr, "  ERROR %d: Failed to preallocate "
>  			"space to %ld bytes\n", errno, (long) length);
> +	}
>  
>  	return ret;
>  }
> @@ -290,8 +294,14 @@ static int test09(int fd, int testnum)
>  
>  	/* preallocate 8M space to file */
>  	ret = do_fallocate(fd, 0, filsz, 0);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		/* Report success if fs doesn't support fallocate */
> +		if (errno == EOPNOTSUPP) {
> +			fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n");
> +			ret = 0;
> +		}
>  		goto out;
> +	}
>  
>  	ret = do_pwrite(fd, buf, bufsz, bufsz * 10);
>  	if (!ret) {
> @@ -336,8 +346,14 @@ static int test08(int fd, int testnum)
>  
>  	/* preallocate 4M space to file */
>  	ret = do_fallocate(fd, 0, filsz, 0);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		/* Report success if fs doesn't support fallocate */
> +		if (errno == EOPNOTSUPP) {
> +			fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n");
> +			ret = 0;
> +		}
>  		goto out;
> +	}
>  
>  	ret = do_pwrite(fd, buf, bufsz, bufsz * 10);
>  	if (ret)
> @@ -379,8 +395,14 @@ static int test07(int fd, int testnum)
>  
>  	/* preallocate 4M space to file */
>  	ret = do_fallocate(fd, 0, filsz, 0);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		/* Report success if fs doesn't support fallocate */
> +		if (errno == EOPNOTSUPP) {
> +			fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n");
> +			ret = 0;
> +		}
>  		goto out;
> +	}
>  
>  	ret = do_pwrite(fd, buf, bufsz, bufsz * 10);
>  	if (ret)
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

  reply	other threads:[~2013-05-31 17:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 15:45 [PATCH] xfstests: fix seek_sanity_test for fs w/o fallocate Eric Sandeen
2013-05-31 17:24 ` Zheng Liu [this message]
2013-05-31 17:24   ` Zheng Liu
2013-05-31 17:15   ` Eric Sandeen
2013-05-31 17:15     ` Eric Sandeen
2013-05-31 19:02     ` Rich Johnston
2013-06-01  4:51       ` Eric Sandeen
2013-06-01  4:51         ` Eric Sandeen
2013-06-01 15:51       ` gnehzuil.liu
2013-06-03 12:42 ` Rich Johnston
2013-06-03 12:42   ` Rich Johnston

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=20130531172456.GB6915@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.