Re: [PATCH] common/filter: prepend 0 to treat offset as octal

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



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@xxxxxxx>

<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@xxxxxxxxxx>

--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
> 



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux