xfs
[Top] [All Lists]

RE: [PATCH] xfstests: fsstress: fix incorrect if condition check for col

To: 'Lukáš Czerner' <lczerner@xxxxxxxxxx>
Subject: RE: [PATCH] xfstests: fsstress: fix incorrect if condition check for collapse range mode
From: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
Date: Wed, 30 Apr 2014 19:43:45 +0900
Cc: 'Dave Chinner' <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, 'Ashish Sangwan' <a.sangwan@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dlp-filter: Pass
In-reply-to: <alpine.LFD.2.00.1404301223160.2100@xxxxxxxxxxxxxxxxxxxxx>
References: <004401cf645c$8f874710$ae95d530$@samsung.com> <alpine.LFD.2.00.1404301223160.2100@xxxxxxxxxxxxxxxxxxxxx>
Thread-index: AQFL8FRQV/1ByKD/Hmc7SCYcTilluQFQgstanCZdKJA=
> On Wed, 30 Apr 2014, Namjae Jeon wrote:
> 
> > Date: Wed, 30 Apr 2014 19:11:32 +0900
> > From: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
> > To: Dave Chinner <david@xxxxxxxxxxxxx>
> > Cc: xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx,
> >     Ashish Sangwan <a.sangwan@xxxxxxxxxxx>
> > Subject: [PATCH] xfstests: fsstress: fix incorrect if condition check for
> >     collapse range mode
> >
> > There is if condition to be block aligned for off and len of Collapse range.
> > But off and len for all fallocate opearion can be aligned by incorrect
> > if condition check.
> >
> > Signed-off-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
> > Signed-off-by: Ashish Sangwan <a.sangwan@xxxxxxxxxxx>
> > ---
> >  ltp/fsstress.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> > index 29fc250..ff9ed12 100644
> > --- a/ltp/fsstress.c
> > +++ b/ltp/fsstress.c
> > @@ -2230,7 +2230,7 @@ do_fallocate(int opno, long r, int mode)
> >      * Collapse range requires off and len to be block aligned, make it
> >      * more likely to be the case.
> >      */
> > -   if (FALLOC_FL_COLLAPSE_RANGE && (opno % 2)) {
> > +   if (mode & FALLOC_FL_COLLAPSE_RANGE && (opno % 2)) {
> >             off = ((off + stb.st_blksize - 1) & ~(stb.st_blksize - 1));
> >             len = ((len + stb.st_blksize - 1) & ~(stb.st_blksize - 1));
> >     }
> 
> oops :). Thanks for fixing it. Even though it would be better to use
> parentheses
Hi Lukas.
Okay, I will send v2 patch.
Thanks for review!
> 
> +     if ((mode & FALLOC_FL_COLLAPSE_RANGE) && (opno % 2)) {
> 
> Reviewed-by: Lukas Czerner <lczerner@xxxxxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>