Linux block layer
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH blktests] common/rc: fix kernel version parse failure
Date: Mon, 1 May 2023 04:32:24 +0000	[thread overview]
Message-ID: <35a949bd-2003-261f-f68f-236c3ca4400e@nvidia.com> (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")

I was about to post the same fix as nvme queue count testcase if not running
with postfix letters. Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



  reply	other threads:[~2023-05-01  4:32 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 [this message]
2023-05-01 16:38 ` Bart Van Assche
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=35a949bd-2003-261f-f68f-236c3ca4400e@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --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