public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Omar Sandoval <osandov@fb.com>,
	linux-block@vger.kernel.org,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Subject: Re: [PATCH blktests v2 1/4] Make _exit_null_blk remove all null_blk device instances
Date: Fri, 20 Mar 2020 13:04:26 -0700	[thread overview]
Message-ID: <20200320200426.GB32817@vader> (raw)
In-Reply-To: <20200315221320.613-2-bvanassche@acm.org>

On Sun, Mar 15, 2020 at 03:13:17PM -0700, Bart Van Assche wrote:
> Instead of making every test remove null_blk device instances before calling
> _exit_null_blk(), move the null_blk device instance removal code into
> _exit_null_blk().
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  common/null_blk | 12 ++++++++----
>  tests/block/022 |  3 ---
>  tests/block/029 |  1 -
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/common/null_blk b/common/null_blk
> index 2e300c20bbc7..6a5f99aaae9d 100644
> --- a/common/null_blk
> +++ b/common/null_blk
> @@ -8,11 +8,14 @@ _have_null_blk() {
>  	_have_modules null_blk
>  }
>  
> +_remove_null_blk_devices() {
> +	local d
> +
> +	for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d"; done

I'd prefer to keep the deletion code using find from _init_null_blk.

> +}
> +
>  _init_null_blk() {
> -	if [[ -d /sys/kernel/config/nullb ]]; then
> -		find /sys/kernel/config/nullb -mindepth 1 -maxdepth 1 \
> -		     -type d -delete
> -	fi
> +	_remove_null_blk_devices
>  
>  	local zoned=""
>  	if (( RUN_FOR_ZONED )); then zoned="zoned=1"; fi
> @@ -27,5 +30,6 @@ _init_null_blk() {
>  
>  _exit_null_blk() {
>  	udevadm settle
> +	_remove_null_blk_devices

This needs to happen before the udevadm settle.

  parent reply	other threads:[~2020-03-20 20:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-15 22:13 [PATCH blktests v2 0/4] Add a test that triggers the blk_mq_realloc_hw_ctxs() error path Bart Van Assche
2020-03-15 22:13 ` [PATCH blktests v2 1/4] Make _exit_null_blk remove all null_blk device instances Bart Van Assche
2020-03-15 23:22   ` Chaitanya Kulkarni
2020-03-16  0:25     ` Bart Van Assche
2020-03-20 20:04   ` Omar Sandoval [this message]
2020-03-15 22:13 ` [PATCH blktests v2 2/4] Use _{init,exit}_null_blk instead of open-coding these functions Bart Van Assche
2020-03-15 23:22   ` Chaitanya Kulkarni
2020-03-15 22:13 ` [PATCH blktests v2 3/4] Introduce the function _configure_null_blk() Bart Van Assche
2020-03-15 23:34   ` Chaitanya Kulkarni
2020-03-20 20:16   ` Omar Sandoval
2020-03-15 22:13 ` [PATCH blktests v2 4/4] Add a test that triggers the blk_mq_realloc_hw_ctxs() error path Bart Van Assche
2020-03-15 23:36   ` Chaitanya Kulkarni
2020-03-20 21:42   ` Omar Sandoval
2020-04-21  2:35     ` Shinichiro Kawasaki
2020-04-21  9:10       ` 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=20200320200426.GB32817@vader \
    --to=osandov@osandov.com \
    --cc=bvanassche@acm.org \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.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