From: Naohiro Aota <Naohiro.Aota@wdc.com>
To: WenRuo Qu <wqu@suse.com>, Naohiro Aota <Naohiro.Aota@wdc.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/3] btrfs-progs: tests: add {,cond_}wait_for_nullbdevs
Date: Wed, 3 Sep 2025 07:42:17 +0000 [thread overview]
Message-ID: <DCIZUQZGZZP2.3FTX5QSTUTI69@wdc.com> (raw)
In-Reply-To: <99046aa7-0737-4131-8790-2112d33a384f@suse.com>
On Tue Sep 2, 2025 at 6:15 PM JST, Qu Wenruo wrote:
>
>
> 在 2025/9/2 13:59, Naohiro Aota 写道:
>> It is a nullb version of {,cond_}wait_for_loopdevs. It waits for all the
>> nullb devices are ready to use.
>>
>> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
>> ---
>> tests/common | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/tests/common b/tests/common
>> index 2c90acb90cfc..1df37c390bf6 100644
>> --- a/tests/common
>> +++ b/tests/common
>> @@ -984,6 +984,20 @@ cleanup_nullbdevs()
>> name=$(basename "$dev")
>> run_check $SUDO_HELPER "$nullb" rm "$name"
>> done
>> + unset nullb_devs
>> +}
>> +
>> +wait_for_nullbdevs()
>> +{
>> + for dev in ${nullb_devs[@]}; do
>> + run_mayfail $SUDO_HELPER "$TOP/btrfs" device ready "$dev"
>> + done
>> +}
>> +
>> +cond_wait_for_nullbdevs() {
>> + if [ -n "${nullb_devs[1]}" ]; then
>> + wait_for_nullbdevs
>> + fi
>
> I guess we don't need cond_wait_for_nummbdevs()?
>
> As if nullb_devs array is not defined/empty, the for loop inside
> wait_for_nullbdevs() will do nothing anyway.
Ah, yes, that's correct. I followed cond_wait_for_loopdevs here. Maybe,
we should drop wait_for_loopdevs and convert the callers as wel.
>
> Thanks,
> Qu
>
>> }
>>
>> init_env()
next prev parent reply other threads:[~2025-09-03 7:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 4:29 [PATCH 0/3] btrfs-progs: tests: add new mkfs test for zoned device Naohiro Aota
2025-09-02 4:29 ` [PATCH 1/3] btrfs-progs: tests: check nullb index for the error case Naohiro Aota
2025-09-02 9:11 ` Qu Wenruo
2025-09-03 7:56 ` Naohiro Aota
2025-09-02 4:29 ` [PATCH 2/3] btrfs-progs: tests: add {,cond_}wait_for_nullbdevs Naohiro Aota
2025-09-02 9:15 ` Qu Wenruo
2025-09-03 7:42 ` Naohiro Aota [this message]
2025-09-02 4:29 ` [PATCH 3/3] btrfs-progs: tests: add new mkfs test for zoned device Naohiro Aota
2025-09-02 9:22 ` Qu Wenruo
2025-09-02 9:59 ` Johannes Thumshirn
2025-09-02 18:57 ` David Sterba
2025-09-03 7:45 ` Naohiro Aota
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=DCIZUQZGZZP2.3FTX5QSTUTI69@wdc.com \
--to=naohiro.aota@wdc.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.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