All of lore.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 v4 2/3] bcache: add bcache/002
Date: Tue, 17 Feb 2026 07:50:04 +0000	[thread overview]
Message-ID: <aZQcH-d-ZcgtMoJb@shinmob> (raw)
In-Reply-To: <20260212-bcache-v4-2-215f3fde1c84@suse.de>

On Feb 12, 2026 / 16:23, Daniel Wagner wrote:
> Add test case from Stephen Zhang [1].
> 
> [1] https://lore.kernel.org/linux-bcache/CANubcdX7eNbH_bo4-f94DUbdiEbt04Vxy1MPyhm+CZyXB01FuQ@mail.gmail.com/
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>

Thank you for adding this patch. When I ran this test case in my test
environment using the kernel v6.19, it failed:

    runtime  7.536s  ...  7.214s
    --- tests/bcache/002.out    2026-02-14 21:16:20.918000000 +0900
    +++ /home/shin/Blktests/blktests/results/nvme0n1_nvme2n1_nvme3n1_nvme4n1/bcache/002.out.bad 2026-02-16 14:29:25.596000000 +0900
    @@ -1,2 +1,3 @@
     Running bcache/002
     Device state: no cache
    +ERROR: Accounting leak detected!

Is this failure expected?

And let me leave a few nit comments in line.

> ---
>  tests/bcache/002     | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/bcache/002.out |  2 ++
>  2 files changed, 64 insertions(+)
> 
> diff --git a/tests/bcache/002 b/tests/bcache/002
> new file mode 100755
> index 000000000000..c27178a90c2d
> --- /dev/null
> +++ b/tests/bcache/002
[...]
> +test_device_array() {
> +	echo "Running ${TEST_NAME}"
> +
> +	if [[ ${#TEST_DEV_ARRAY[@]} -lt 2 ]]; then
> +		SKIP_REASONS+=("requires at least 2 devices")
> +		return 1
> +	fi
> +
> +	_setup_bcache "${TEST_DEV_ARRAY[@]}"
> +
> +	local bcache_nodes bcache_dev bdev_name fio_pid

Nit: I think bcache_nodes should be declared as an array, with -a option.
     Also, 'state' can be added to this local var list.

> +
> +	mapfile -t bcache_nodes < <(_create_bcache \
> +				--cache "${TEST_DEV_ARRAY[0]##*/}" \
> +				--bdev "${TEST_DEV_ARRAY[1]##*/}" \
> +				--writeback)
> +
> +	bcache_dev="${bcache_nodes[0]}"
> +	bdev_name="$(basename "${bcache_dev}")"
> +	echo 1 > /sys/block/"${bdev_name}"/bcache/detach
> +
> +	state="$(cat /sys/block/"${bdev_name}"/bcache/state)"
> +	echo "Device state: ${state}"
> +
> +	_run_fio_rand_io --filename="${bcache_dev}" --time_base \
> +			--runtime=30 >> "$FULL" 2>&1 &
> +	fio_pid=$!
> +
> +	sleep 5
> +
> +	local stats_line util
> +	stats_line=$(iostat -x 1 2 "${bdev_name}" | grep -w "${bdev_name}" | tail -n 1)
> +	util="$(echo "${stats_line}" | awk '{print $NF}')"
> +
> +	if (( $(echo "${util} > 1.0" | bc -l) )); then

Nit: bc -l option can be --mathlib for readability.

> +		echo "ERROR: Accounting leak detected!"
> +	fi
> +
> +	{ pkill -f "fio.*${bcache_dev}"; wait "${fio_pid}"; } &> /dev/null

Nit: pkill -f option can be --full for readability.

> +
> +	_remove_bcache --bcache "${bcache_nodes[@]}" \
> +			--cache "${TEST_DEV_ARRAY[0]##*/}" \
> +			--bdev "${TEST_DEV_ARRAY[1]##*/}"
> +}

  reply	other threads:[~2026-02-17  7:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 15:23 [PATCH blktests v4 0/3] bcache: add initial test cases Daniel Wagner
2026-02-12 15:23 ` [PATCH blktests v4 1/3] bcache: add bcache/001 Daniel Wagner
2026-02-17  7:42   ` Shinichiro Kawasaki
2026-02-12 15:23 ` [PATCH blktests v4 2/3] bcache: add bcache/002 Daniel Wagner
2026-02-17  7:50   ` Shinichiro Kawasaki [this message]
2026-02-12 15:23 ` [PATCH blktests v4 3/3] doc: document how to configure bcache tests Daniel Wagner
2026-03-02 13:54 ` [PATCH blktests v4 0/3] bcache: add initial test cases Daniel Wagner
2026-03-03  0:57   ` Shinichiro Kawasaki
2026-03-03  8:04     ` Daniel Wagner
2026-03-04  6:41       ` Stephen Zhang

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=aZQcH-d-ZcgtMoJb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.