]> www.infradead.org Git - users/hch/blktests.git/commit
tests/nvme/rc: Fix possible endless loop
authorLi Zhijian <lizhijian@fujitsu.com>
Tue, 17 May 2022 06:22:35 +0000 (14:22 +0800)
committerOmar Sandoval <osandov@osandov.com>
Tue, 17 May 2022 23:43:49 +0000 (16:43 -0700)
commitefdc8a60985bad0324e2265356b3a292514f72a7
tree6dce89c7a6cda056669b7af9aad4553bd607edd7
parent459c0c1bbbae7b70d4c89f8c8516344391527d45
tests/nvme/rc: Fix possible endless loop

A failed connection will cause the later endless loop, so we should return
directly in such case.

344 _nvmet_passthru_target_connect() {
345         local trtype=$1
346         local subsys_name=$2
347
348         _nvme_connect_subsys "${trtype}" "${subsys_name}" || return
349         nsdev=$(_find_nvme_passthru_loop_dev "${subsys_name}")
350
351         # The following tests can race with the creation
352         # of the device so ensure the block device exists
353         # before continuing
354         while [ ! -b "${nsdev}" ]; do sleep 1; done <<< endless loop
355
356         echo "${nsdev}"
357 }

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
tests/nvme/rc