All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common/filter: prepend 0 to treat offset as octal
@ 2019-12-12  3:11 Naohiro Aota
  2019-12-12  6:04 ` Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Naohiro Aota @ 2019-12-12  3:11 UTC (permalink / raw)
  To: fstests; +Cc: Naohiro Aota

The offsets printed by "od" are octal numbers. So, we need to add "0" at
the head of the $offset to parse it as an octal number.

Fixes: 37520a314bd4 ("fstests: Don't use gawk's strtonum")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/filter b/common/filter
index 6140e58368d7..88fcb6ef68ee 100644
--- a/common/filter
+++ b/common/filter
@@ -495,7 +495,7 @@ _filter_od()
 		fi
 
 		offset="${line%% *}"
-		printf '%o%s\n' $((offset / BLOCK_SIZE)) "${line#$offset}"
+		printf '%o%s\n' $(("0$offset" / BLOCK_SIZE)) "${line#$offset}"
 	done
 }
 
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] common/filter: prepend 0 to treat offset as octal
  2019-12-12  3:11 [PATCH] common/filter: prepend 0 to treat offset as octal Naohiro Aota
@ 2019-12-12  6:04 ` Darrick J. Wong
  2019-12-12  6:10   ` Darrick J. Wong
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Darrick J. Wong @ 2019-12-12  6:04 UTC (permalink / raw)
  To: Naohiro Aota; +Cc: fstests

On Thu, Dec 12, 2019 at 12:11:52PM +0900, Naohiro Aota wrote:
> The offsets printed by "od" are octal numbers. So, we need to add "0" at
> the head of the $offset to parse it as an octal number.
> 
> Fixes: 37520a314bd4 ("fstests: Don't use gawk's strtonum")
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

<grumble> Did the original patch author run all the tests that use
_filter_od to make sure there weren't any regressions.  This fixes
xfs/139 for me, so...

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  common/filter | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/filter b/common/filter
> index 6140e58368d7..88fcb6ef68ee 100644
> --- a/common/filter
> +++ b/common/filter
> @@ -495,7 +495,7 @@ _filter_od()
>  		fi
>  
>  		offset="${line%% *}"
> -		printf '%o%s\n' $((offset / BLOCK_SIZE)) "${line#$offset}"
> +		printf '%o%s\n' $(("0$offset" / BLOCK_SIZE)) "${line#$offset}"
>  	done
>  }
>  
> -- 
> 2.24.0
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] common/filter: prepend 0 to treat offset as octal
  2019-12-12  6:04 ` Darrick J. Wong
@ 2019-12-12  6:10   ` Darrick J. Wong
  2019-12-12 10:00   ` Kusanagi Kouichi
  2019-12-15 16:07   ` Eryu Guan
  2 siblings, 0 replies; 6+ messages in thread
From: Darrick J. Wong @ 2019-12-12  6:10 UTC (permalink / raw)
  To: Naohiro Aota; +Cc: fstests

On Wed, Dec 11, 2019 at 10:04:37PM -0800, Darrick J. Wong wrote:
> On Thu, Dec 12, 2019 at 12:11:52PM +0900, Naohiro Aota wrote:
> > The offsets printed by "od" are octal numbers. So, we need to add "0" at
> > the head of the $offset to parse it as an octal number.
> > 
> > Fixes: 37520a314bd4 ("fstests: Don't use gawk's strtonum")
> > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> 
> <grumble> Did the original patch author run all the tests that use
> _filter_od to make sure there weren't any regressions.  This fixes
> xfs/139 for me, so...
> 
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

...also, thank you for fixing this problem. :)

--D

> --D
> 
> > ---
> >  common/filter | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/common/filter b/common/filter
> > index 6140e58368d7..88fcb6ef68ee 100644
> > --- a/common/filter
> > +++ b/common/filter
> > @@ -495,7 +495,7 @@ _filter_od()
> >  		fi
> >  
> >  		offset="${line%% *}"
> > -		printf '%o%s\n' $((offset / BLOCK_SIZE)) "${line#$offset}"
> > +		printf '%o%s\n' $(("0$offset" / BLOCK_SIZE)) "${line#$offset}"
> >  	done
> >  }
> >  
> > -- 
> > 2.24.0
> > 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] common/filter: prepend 0 to treat offset as octal
  2019-12-12  6:04 ` Darrick J. Wong
  2019-12-12  6:10   ` Darrick J. Wong
@ 2019-12-12 10:00   ` Kusanagi Kouichi
  2019-12-15 16:08     ` Eryu Guan
  2019-12-15 16:07   ` Eryu Guan
  2 siblings, 1 reply; 6+ messages in thread
From: Kusanagi Kouichi @ 2019-12-12 10:00 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eryu Guan, Naohiro Aota, fstests

On 2019-12-11 22:04:37 -0800, Darrick J. Wong wrote:
> On Thu, Dec 12, 2019 at 12:11:52PM +0900, Naohiro Aota wrote:
> > The offsets printed by "od" are octal numbers. So, we need to add "0" at
> > the head of the $offset to parse it as an octal number.
> > 
> > Fixes: 37520a314bd4 ("fstests: Don't use gawk's strtonum")
> > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> 
> <grumble> Did the original patch author run all the tests that use
> _filter_od to make sure there weren't any regressions.  This fixes
> xfs/139 for me, so...

I'm sorry. I didn't test well. Eryu, can you revert commit 37520a314bd4?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] common/filter: prepend 0 to treat offset as octal
  2019-12-12  6:04 ` Darrick J. Wong
  2019-12-12  6:10   ` Darrick J. Wong
  2019-12-12 10:00   ` Kusanagi Kouichi
@ 2019-12-15 16:07   ` Eryu Guan
  2 siblings, 0 replies; 6+ messages in thread
From: Eryu Guan @ 2019-12-15 16:07 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Naohiro Aota, fstests

On Wed, Dec 11, 2019 at 10:04:37PM -0800, Darrick J. Wong wrote:
> On Thu, Dec 12, 2019 at 12:11:52PM +0900, Naohiro Aota wrote:
> > The offsets printed by "od" are octal numbers. So, we need to add "0" at
> > the head of the $offset to parse it as an octal number.
> > 
> > Fixes: 37520a314bd4 ("fstests: Don't use gawk's strtonum")
> > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> 
> <grumble> Did the original patch author run all the tests that use
> _filter_od to make sure there weren't any regressions.  This fixes
> xfs/139 for me, so...

My apologies, I did test tests that use _filter_od, but clearly not
include xfs/139..

Eryu

> 
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> 
> --D
> 
> > ---
> >  common/filter | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/common/filter b/common/filter
> > index 6140e58368d7..88fcb6ef68ee 100644
> > --- a/common/filter
> > +++ b/common/filter
> > @@ -495,7 +495,7 @@ _filter_od()
> >  		fi
> >  
> >  		offset="${line%% *}"
> > -		printf '%o%s\n' $((offset / BLOCK_SIZE)) "${line#$offset}"
> > +		printf '%o%s\n' $(("0$offset" / BLOCK_SIZE)) "${line#$offset}"
> >  	done
> >  }
> >  
> > -- 
> > 2.24.0
> > 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] common/filter: prepend 0 to treat offset as octal
  2019-12-12 10:00   ` Kusanagi Kouichi
@ 2019-12-15 16:08     ` Eryu Guan
  0 siblings, 0 replies; 6+ messages in thread
From: Eryu Guan @ 2019-12-15 16:08 UTC (permalink / raw)
  To: Kusanagi Kouichi; +Cc: Darrick J. Wong, Naohiro Aota, fstests

On Thu, Dec 12, 2019 at 07:00:09PM +0900, Kusanagi Kouichi wrote:
> On 2019-12-11 22:04:37 -0800, Darrick J. Wong wrote:
> > On Thu, Dec 12, 2019 at 12:11:52PM +0900, Naohiro Aota wrote:
> > > The offsets printed by "od" are octal numbers. So, we need to add "0" at
> > > the head of the $offset to parse it as an octal number.
> > > 
> > > Fixes: 37520a314bd4 ("fstests: Don't use gawk's strtonum")
> > > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> > 
> > <grumble> Did the original patch author run all the tests that use
> > _filter_od to make sure there weren't any regressions.  This fixes
> > xfs/139 for me, so...
> 
> I'm sorry. I didn't test well. Eryu, can you revert commit 37520a314bd4?

Sure, I'll just revert it for now.

Eryu

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-15 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-12  3:11 [PATCH] common/filter: prepend 0 to treat offset as octal Naohiro Aota
2019-12-12  6:04 ` Darrick J. Wong
2019-12-12  6:10   ` Darrick J. Wong
2019-12-12 10:00   ` Kusanagi Kouichi
2019-12-15 16:08     ` Eryu Guan
2019-12-15 16:07   ` Eryu Guan

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.