[PATCH blktests] nvme/rc: fix nvme device readiness check after _nvme_connect_subsys
Daniel Wagner
dwagner at suse.de
Thu Aug 10 23:37:52 PDT 2023
On Fri, Aug 11, 2023 at 10:23:34AM +0900, Shin'ichiro Kawasaki wrote:
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -425,6 +425,7 @@ _nvme_connect_subsys() {
> local keep_alive_tmo=""
> local reconnect_delay=""
> local ctrl_loss_tmo=""
> + local dev i
>
> while [[ $# -gt 0 ]]; do
> case $1 in
> @@ -529,6 +530,16 @@ _nvme_connect_subsys() {
> fi
>
> nvme connect "${ARGS[@]}" 2> /dev/null
> +
> + dev=$(_find_nvme_dev "$subsysnqn")
> + for ((i = 0; i < 10; i++)); do
> + if [[ -b /dev/${dev}n1 &&
> + -e /sys/block/${dev}n1/uuid &&
> + -e /sys/block/${dev}n1/wwid ]]; then
> + return
> + fi
> + sleep .1
> + done
> }
Not sure if this going to work for the passthru case as intended. If you
look at the _find_nvme_passthru_loop_dev() function, there is a logic to
figure out which namespace to use. _nvmet_passthru_target_connect()
is also using _nvme_connect_subsys() so it is possible that the
test device for the passthru case uses not namespace 1.
If namespace 1 doesn't exist we just loop for 1 second. So in this
particular case nothing changes. Still not nice.
Thinking about it, shouldn't we log that we couldn't find the
device/uuid/wwid at the end of the loop?
More information about the Linux-nvme
mailing list