public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH blktests v2 2/2] block/031: allow to run with built-in null_blk driver
Date: Tue, 9 Jan 2024 12:19:23 -0800	[thread overview]
Message-ID: <4a6b2848-7792-4e11-9fc5-482b8e4e020b@acm.org> (raw)
In-Reply-To: <20240109104453.3764096-3-shinichiro.kawasaki@wdc.com>

On 1/9/24 02:44, Shin'ichiro Kawasaki wrote:
> The test case block/031 sets null_blk parameter shared_tag_bitmap=1 for
> testing.
> The parameter has been set as a module parameter then null_blk
> driver must be loadable.

It seems like the word "If" is missing from the start of the above sentence?

> -	if ! _init_null_blk nr_devices=0 shared_tag_bitmap=1; then
> -		echo "Loading null_blk failed"
> -		return 1
> +	if _have_null_blk_feature shared_tag_bitmap; then
> +		opts+=(shared_tag_bitmap=1)
> +	else
> +		# Old kernel requires shared_tag_bitmap as a module parameter
> +		# instead of configfs parameter.
> +		if ! _init_null_blk shared_tag_bitmap=1; then
> +			echo "Loading null_blk failed"
> +			return 1
> +		fi
>   	fi

_have_null_blk_feature loads the null_blk kernel module as a side effect. The
above code relies on that side effect. I think that _have_null_blk_feature either
should unload the null_blk kernel module or that a comment should be added above
the above if-statement that explains this side effect. Otherwise readers of this
code will wonder why there is an _init_null_blk call in one branch of the
if-statement and not in the other branch.

Thanks,

Bart.

  parent reply	other threads:[~2024-01-09 20:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 10:44 [PATCH blktests v2 0/2] block/031: allow to run with built-in null_blk driver Shin'ichiro Kawasaki
2024-01-09 10:44 ` [PATCH blktests v2 1/2] common/null_blk: introduce _have_null_blk_feature Shin'ichiro Kawasaki
2024-01-09 19:20   ` Chaitanya Kulkarni
2024-01-09 20:14   ` Bart Van Assche
2024-01-09 10:44 ` [PATCH blktests v2 2/2] block/031: allow to run with built-in null_blk driver Shin'ichiro Kawasaki
2024-01-09 19:34   ` Chaitanya Kulkarni
2024-01-09 20:19   ` Bart Van Assche [this message]
2024-01-10  2:19     ` Shinichiro Kawasaki
2024-01-10 17:50       ` Bart Van Assche
2024-01-11  7:34         ` 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=4a6b2848-7792-4e11-9fc5-482b8e4e020b@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