public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: Daniel Wagner <dwagner@suse.de>
Cc: "hch@infradead.org" <hch@infradead.org>,
	Stephen Zhang <starzhangzsd@gmail.com>,
	Kent Overstreet <kent.overstreet@linux.dev>,
	Coly Li <colyli@fnnas.com>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-bcache@vger.kernel.org" <linux-bcache@vger.kernel.org>
Subject: Re: [PATCH blktests v5 1/3] bcache: add bcache/001
Date: Fri, 6 Mar 2026 12:15:10 +0000	[thread overview]
Message-ID: <aarDdfJPu1NBuuvM@shinmob> (raw)
In-Reply-To: <20260305-bcache-v5-1-04cd4c9080d7@suse.de>

On Mar 05, 2026 / 16:01, Daniel Wagner wrote:
> So far we are missing tests for bcache. Besides a relative simple
> setup/teardown tests add also the corresponding infrastructure. More
> tests are to be expected to depend on this.
> 
> _create_bcache/_remove_bcache are tracking the resources and if anything
> is missing it will complain.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>  tests/bcache/001     |  44 ++++++
>  tests/bcache/001.out |   3 +
>  tests/bcache/rc      | 377 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 424 insertions(+)
> 
> diff --git a/tests/bcache/001 b/tests/bcache/001
> new file mode 100755
> index 000000000000..64d5d45d9e6e
> --- /dev/null
> +++ b/tests/bcache/001
[...]
> +_create_bcache() {
> +	local -a cdevs=()
> +	local -a bdevs=()
> +	local -a ARGS=()
> +	local -a created_devs=()
> +	local bucket_size="64k"
> +	local block_size="4k"

[...]

> +	# add /dev prefix to device names
> +	cdevs=( "${cdevs[@]/#/\/dev\/}" )
> +	bdevs=( "${bdevs[@]/#/\/dev\/}" )

Here, /dev/ prefix is added to arguments of _bcache_wipe_devs() call below.

> +
> +	# make-bcache expects empty/cleared devices
> +	_bcache_wipe_devs "${cdevs[@]}" "${bdevs[@]}"

[...]

> +_remove_bcache() {
> +	local -a cdevs=()
> +	local -a bdevs=()
> +	local -a csets=()
> +	local -a bcache_devs=()
> +	local uuid

[...]

> +	local timeout
> +	for cset in "${csets[@]}"; do
> +		timeout=0
> +		while [[ -d /sys/fs/bcache/"${cset}" ]] && (( timeout < 10 )); do
> +			sleep 0.5
> +			(( timeout++ ))
> +		done
> +	done

However, /dev prefix is not added here for the _bcache_wipe_devs() call below. I
added the hunk below, then observed the nvme?n1 files are no longer created in
my environment.

       # add /dev prefix to device names
       cdevs=( "${cdevs[@]/#/\/dev\/}" )
       bdevs=( "${bdevs[@]/#/\/dev\/}" )

Other than this, this patch looks good to me. If you are okay with it, I can
fold-in the change above when I apply this patch.

> +
> +	_bcache_wipe_devs "${cdevs[@]}" "${bdevs[@]}"
> +}

  parent reply	other threads:[~2026-03-06 12:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 15:01 [PATCH blktests v5 0/3] bcache: add initial test cases Daniel Wagner
2026-03-05 15:01 ` [PATCH blktests v5 1/3] bcache: add bcache/001 Daniel Wagner
2026-03-06  9:49   ` Johannes Thumshirn
2026-03-06 12:15   ` Shinichiro Kawasaki [this message]
2026-03-06 12:45     ` Daniel Wagner
2026-03-05 15:01 ` [PATCH blktests v5 2/3] bcache: add bcache/002 Daniel Wagner
2026-03-06  9:59   ` Johannes Thumshirn
2026-03-06 12:27   ` Shinichiro Kawasaki
2026-03-06 13:14     ` Daniel Wagner
2026-03-07 10:24       ` Shinichiro Kawasaki
2026-03-10  9:29         ` Stephen Zhang
2026-03-12  1:44           ` Shinichiro Kawasaki
2026-03-05 15:01 ` [PATCH blktests v5 3/3] doc: document how to configure bcache tests Daniel Wagner
2026-03-06 10:00   ` Johannes Thumshirn
2026-03-07 10:27 ` [PATCH blktests v5 0/3] bcache: add initial test cases Shinichiro Kawasaki
2026-03-09  9:40   ` Daniel Wagner

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=aarDdfJPu1NBuuvM@shinmob \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=colyli@fnnas.com \
    --cc=dwagner@suse.de \
    --cc=hch@infradead.org \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=starzhangzsd@gmail.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