diff mbox

[3/6] xfstests: fsstress punch should always have FALLOC_FL_KEEP_SIZE set

Message ID 1393355728-12056-3-git-send-email-lczerner@redhat.com
State Not Applicable, archived
Headers show

Commit Message

Lukas Czerner Feb. 25, 2014, 7:15 p.m. UTC
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 ltp/fsstress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dave Chinner Feb. 25, 2014, 8:18 p.m. UTC | #1
On Tue, Feb 25, 2014 at 08:15:25PM +0100, Lukas Czerner wrote:
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> ---
>  ltp/fsstress.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> index 4c3368f..42c8a5a 100644
> --- a/ltp/fsstress.c
> +++ b/ltp/fsstress.c
> @@ -2555,8 +2555,8 @@ punch_f(int opno, long r)
>  	off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
>  	off %= maxfsize;
>  	len = (off64_t)(random() % (1024 * 1024));
> -	mode |= FALLOC_FL_KEEP_SIZE & random();
>  	e = fallocate(fd, mode, (loff_t)off, (loff_t)len) < 0 ? errno : 0;
> +	mode |= FALLOC_FL_KEEP_SIZE;
>  	if (v)
>  		printf("%d/%d: punch hole(%d) %s %s %lld %lld %d\n",
>  		       procid, opno, mode,

NACK. There's nothing wrong with testing a set of parameters that
should fail in a stress test.

Regardless, the patch is wrong...

Cheers,

Dave.
Lukas Czerner Feb. 26, 2014, 1:04 p.m. UTC | #2
On Wed, 26 Feb 2014, Dave Chinner wrote:

> Date: Wed, 26 Feb 2014 07:18:54 +1100
> From: Dave Chinner <david@fromorbit.com>
> To: Lukas Czerner <lczerner@redhat.com>
> Cc: linux-ext4@vger.kernel.org, xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org
> Subject: Re: [PATCH 3/6] xfstests: fsstress punch should always have
>     FALLOC_FL_KEEP_SIZE set
> 
> On Tue, Feb 25, 2014 at 08:15:25PM +0100, Lukas Czerner wrote:
> > Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> > ---
> >  ltp/fsstress.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> > index 4c3368f..42c8a5a 100644
> > --- a/ltp/fsstress.c
> > +++ b/ltp/fsstress.c
> > @@ -2555,8 +2555,8 @@ punch_f(int opno, long r)
> >  	off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
> >  	off %= maxfsize;
> >  	len = (off64_t)(random() % (1024 * 1024));
> > -	mode |= FALLOC_FL_KEEP_SIZE & random();
> >  	e = fallocate(fd, mode, (loff_t)off, (loff_t)len) < 0 ? errno : 0;
> > +	mode |= FALLOC_FL_KEEP_SIZE;
> >  	if (v)
> >  		printf("%d/%d: punch hole(%d) %s %s %lld %lld %d\n",
> >  		       procid, opno, mode,
> 
> NACK. There's nothing wrong with testing a set of parameters that
> should fail in a stress test.

How is this testing ? We do not actually test whether it fails when
it should and vice versa. Only thing that it does right now is
making punch hole testing less efficient.

We do not really test correctness of the arguments in fsstress.

-Lukas

> 
> Regardless, the patch is wrong...
> 
> Cheers,
> 
> Dave.
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index 4c3368f..42c8a5a 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -2555,8 +2555,8 @@  punch_f(int opno, long r)
 	off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
 	off %= maxfsize;
 	len = (off64_t)(random() % (1024 * 1024));
-	mode |= FALLOC_FL_KEEP_SIZE & random();
 	e = fallocate(fd, mode, (loff_t)off, (loff_t)len) < 0 ? errno : 0;
+	mode |= FALLOC_FL_KEEP_SIZE;
 	if (v)
 		printf("%d/%d: punch hole(%d) %s %s %lld %lld %d\n",
 		       procid, opno, mode,