Skip to contentSkip to conversation

nvmeof-mp/rc: fix nvmeof-mp failure when NVME_TARGET_PASSTHRU enabled

PATCH Applied Yi Zhang 3 participants 3 messages Jan 24, 2021 – Jan 25, 2021 Block layer

lore
Share & tools
lore

Yi Zhang

author
#0 lore raw

PATCH 1/1 nvmeof-mp/rc: fix nvmeof-mp failure when NVME_TARGET_PASSTHRU enabled

$ ./check nvmeof-mp/001
nvmeof-mp/001 (Log in and log out)                           [passed]
    runtime  0.400s  ...  0.457s
rmdir: failed to remove 'subsystems/nvme-test/passthru/admin_timeout': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/device_path': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/enable': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/io_timeout': Not a directory
---
 tests/nvmeof-mp/rc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/nvmeof-mp/rc +2 -2
index c77526f..ab7770f 100755
@@ -265,8 +265,8 @@ stop_nvme_target() {
 			rm -f -- ports/*/subsystems/* &&
 			for d in {*/*/*/*,*/*}; do
 				[ -e "$d" ] &&
-					[ "$(basename "$(dirname "$d")")" != ana_groups ] &&
-					rmdir "$d"
+				[[ ! "$(basename "$(dirname "$d")")" =~ ana_groups|passthru ]] &&
+				rmdir "$d"
 			done
 	)
 	unload_module nvmet_rdma &&
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Yi Zhang
$ ./check nvmeof-mp/001
nvmeof-mp/001 (Log in and log out)                           [passed]
    runtime  0.400s  ...  0.457s
rmdir: failed to remove 'subsystems/nvme-test/passthru/admin_timeout': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/device_path': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/enable': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/io_timeout': Not a directory
---
 tests/nvmeof-mp/rc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/nvmeof-mp/rc +0 -0
index c77526f..ab7770f 100755

tests/nvmeof-mp/rc stop_nvme_target() { · line 272

Quoted 10 lines
tests/nvmeof-mp/rc +2 -2
@@ -265,8 +265,8 @@ stop_nvme_target() {
 			rm -f -- ports/*/subsystems/* &&
 			for d in {*/*/*/*,*/*}; do
 				[ -e "$d" ] &&
-					[ "$(basename "$(dirname "$d")")" != ana_groups ] &&
-					rmdir "$d"
+				[[ ! "$(basename "$(dirname "$d")")" =~ ana_groups|passthru ]] &&
+				rmdir "$d"
 			done
 	)
 	unload_module nvmet_rdma &&
#2 lore raw
In reply to Yi Zhang
Quoted 9 lines · Yi Zhang
$ ./check nvmeof-mp/001
nvmeof-mp/001 (Log in and log out)                           [passed]
    runtime  0.400s  ...  0.457s
rmdir: failed to remove 'subsystems/nvme-test/passthru/admin_timeout': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/device_path': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/enable': Not a directory
rmdir: failed to remove 'subsystems/nvme-test/passthru/io_timeout': Not a directory

Thanks, applied.