From: Bart Van Assche <bvanassche@acm.org>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
linux-block@vger.kernel.org
Subject: Re: [PATCH blktests] common/rc: fix kernel version parse failure
Date: Mon, 1 May 2023 09:38:07 -0700 [thread overview]
Message-ID: <a8064311-1e5a-936f-8517-e84a23a8876e@acm.org> (raw)
In-Reply-To: <20230501041415.49939-1-shinichiro.kawasaki@wdc.com>
On 4/30/23 21:14, Shin'ichiro Kawasaki wrote:
> When kernel version numbers have postfix letters, _have_fio_ver fail to
> parse the version. For example, uname -r returns "6.3.0+", it handles
> "0+" as a number and fails to parse. Fix it by dropping all letters
> other than numbers or period.
>
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
> common/rc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/rc b/common/rc
> index af4c0b1..525867c 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -207,7 +207,7 @@ _have_kernel_option() {
> _have_kver() {
> local d=$1 e=$2 f=$3
>
> - IFS='.' read -r a b c < <(uname -r | sed 's/-.*//')
> + IFS='.' read -r a b c < <(uname -r | sed 's/-.*//' | sed 's/[^.0-9]//')
> if [ $((a * 65536 + b * 256 + c)) -lt $((d * 65536 + e * 256 + f)) ];
> then
> SKIP_REASONS+=("Kernel version too old")
Please combine the two sed statements into a single sed statement, e.g. as
follows:
sed 's/-.*//;s/[^.0-9]//'
Thanks,
Bart.
next prev parent reply other threads:[~2023-05-01 16:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-01 4:14 [PATCH blktests] common/rc: fix kernel version parse failure Shin'ichiro Kawasaki
2023-05-01 4:32 ` Chaitanya Kulkarni
2023-05-01 16:38 ` Bart Van Assche [this message]
2023-05-02 4:12 ` Shinichiro Kawasaki
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=a8064311-1e5a-936f-8517-e84a23a8876e@acm.org \
--to=bvanassche@acm.org \
--cc=linux-block@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.com \
/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