From: Guixin Liu <kanie@linux.alibaba.com>
To: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: "dwagner@suse.de" <dwagner@suse.de>,
"chaitanyak@nvidia.com" <chaitanyak@nvidia.com>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH blktests v2] nvme/{common/nvme, 051, 052}: introduce def_nsid
Date: Thu, 31 Oct 2024 17:47:25 +0800 [thread overview]
Message-ID: <505e459b-8c18-4c7c-bad5-23b9bbe4ca3f@linux.alibaba.com> (raw)
In-Reply-To: <mb3o3dkfgvq7etpplvq6cvcbbkhmvvnmge4omxu7nqzihgzwdt@rbytctuhijw3>
在 2024/10/31 15:54, Shinichiro Kawasaki 写道:
> On Oct 31, 2024 / 10:35, Guixin Liu wrote:
>> Use def_nsid instead of hard code, the default of def_nsid is 1.
>>
>> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
>> Reviewed-by: Daniel Wagner <dwagner@suse.de>
>> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
>> ---
>> Changes from v1 to v2:
>> - change the hard code in _remove_nvmet_subsystem() to fix
>> the nvme/004 fail if change def_nsid to 2.
> Thanks for the update. I think you overlooked my other comments for v1, which
> were at the end of my e-mail [1].
>
> [1] https://lore.kernel.org/linux-nvme/33susvhlxjt2uf3gqldcb2n43pgrvt5m2wj6b27nbgeoxamfkn@az45ko2fsydt/
>
> Here I quote my comments:
>
> ------------------------------------------------------------------------------
> After this change, when def_nsid is larger than iteration=20, nvme/052 will do
> nothing. I think the change should be like this:
>
> for ((i = 2; i <= iterations; i++)); do {
> nsid=$((def_nsid + i - 1))
Sorry I miss this, I think here "i" can be start with 1, and
nsid=$((def_nsid + i)).
Changed in v3.
> truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path).${nsid}"
> uuid=$(_create_nvmet_ns --blkdev "$(_nvme_def_file_path).${nsid}" \
> --nsid "${nsid}")
> ....
>
> Also, same change will be required in nvme/016 and nvme/017. They also use the
> --nsid option.
>
> $ git grep -e "--nsid"
> common/nvme: --nsid)
> tests/nvme/016: _create_nvmet_ns --nsid "${i}" \
> tests/nvme/017: _create_nvmet_ns --nsid "${i}" \
> tests/nvme/052: --nsid "${i}")
Also changed in v3, thanks.
> ------------------------------------------------------------------------------
>
> And I have one more comment below.
>
> [...]
>> diff --git a/tests/nvme/052 b/tests/nvme/052
>> index 1dcda23..781a9f0 100755
>> --- a/tests/nvme/052
>> +++ b/tests/nvme/052
>> @@ -57,10 +57,10 @@ test() {
>>
>> _nvme_connect_subsys
>>
>> - # start iteration from ns-id 2 because ns-id 1 is created
>> - # by default when nvme target is setup. Also ns-id 1 is
>> + # start iteration from def_nsid+1 because def_nsid is created
>> + # by default when nvme target is setup. Also def_nsid is
>> # deleted when nvme target is cleaned up.
>> - for ((i = 2; i <= iterations; i++)); do {
>> + for ((i = $((${def_nsid})) + 1; i <= iterations; i++)); do {
>> truncate -s "${NVME_IMG_SIZE}" "$(_nvme_def_file_path).$i"
>> uuid="$(uuidgen -r)"
> The change above causes the shellcheck error below. Do you see the error in your
> environment?
>
> ------------------------------------------------------------------------------
> $ make check
> shellcheck -x -e SC2119 -f gcc check common/* \
> tests/*/rc tests/*/[0-9]*[0-9] src/*.sh
> tests/nvme/052:63:15: note: $/${} is unnecessary on arithmetic variables. [SC2004]
> make: *** [Makefile:21: check] Error 1
> ------------------------------------------------------------------------------
If change to nsid=$((def_nsid + i)), no error report now.
Thanks, I will remember to run "make check" before I send the patch.
Best Regards,
Guixin Liu
prev parent reply other threads:[~2024-10-31 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 2:35 [PATCH blktests v2] nvme/{common/nvme, 051, 052}: introduce def_nsid Guixin Liu
2024-10-31 7:54 ` Shinichiro Kawasaki
2024-10-31 9:47 ` Guixin Liu [this message]
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=505e459b-8c18-4c7c-bad5-23b9bbe4ca3f@linux.alibaba.com \
--to=kanie@linux.alibaba.com \
--cc=chaitanyak@nvidia.com \
--cc=dwagner@suse.de \
--cc=linux-nvme@lists.infradead.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