From: Naohiro Aota <naohiro.aota@wdc.com>
To: fstests@vger.kernel.org
Cc: Naohiro Aota <naohiro.aota@wdc.com>
Subject: [PATCH] common/filter: prepend 0 to treat offset as octal
Date: Thu, 12 Dec 2019 12:11:52 +0900 [thread overview]
Message-ID: <20191212031152.1906287-1-naohiro.aota@wdc.com> (raw)
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
next reply other threads:[~2019-12-12 3:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 3:11 Naohiro Aota [this message]
2019-12-12 6:04 ` [PATCH] common/filter: prepend 0 to treat offset as octal 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
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=20191212031152.1906287-1-naohiro.aota@wdc.com \
--to=naohiro.aota@wdc.com \
--cc=fstests@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).