nvmeof-mp/001: fix failure when CONFIG_NVME_HWMON enabled
Subsystems (2)
PATCH 1/1 nvmeof-mp/001: fix failure when CONFIG_NVME_HWMON enabled
Skip checking ng0n1/hwmon5 in count_devices
$ use_siw=1 ./check nvmeof-mp/001
nvmeof-mp/001 (Log in and log out) [failed]
runtime 3.695s ... 4.002s
--- tests/nvmeof-mp/001.out 2021-09-12 05:35:17.866892187 -0400
+++ /root/blktests/results/nodev/nvmeof-mp/001.out.bad 2021-09-12 06:49:25.621880616 -0400
@@ -1,3 +1,3 @@
Configured NVMe target driver
-count_devices(): 1 <> 1
+count_devices(): 3 <> 1
Passed
$ ls -l /sys/class/nvme-fabrics/ctl/*/*/device
lrwxrwxrwx. 1 root root 0 Sep 12 06:49 /sys/class/nvme-fabrics/ctl/nvme0/hwmon5/device -> ../../nvme0
lrwxrwxrwx. 1 root root 0 Sep 12 06:49 /sys/class/nvme-fabrics/ctl/nvme0/ng0n1/device -> ../../nvme0
lrwxrwxrwx. 1 root root 0 Sep 12 06:49 /sys/class/nvme-fabrics/ctl/nvme0/nvme0n1/device -> ../../nvme0Signed-off-by Yi Zhang <[email protected]>
--- tests/nvmeof-mp/001 | 1 + 1 file changed, 1 insertion(+)
tests/nvmeof-mp/001 +1 -0
@@ -11,6 +11,7 @@ count_devices() { local d devs=0 for d in /sys/class/nvme-fabrics/ctl/*/*/device; do + [[ "$d" =~ hwmon[0-9]|ng[0-9]n[0-9] ]] && continue [ -d "$d" ] && ((devs++)) done echo "$devs"
Signature · 1 line
2.21.3
Quoted 27 lines · Yi Zhang
Skip checking ng0n1/hwmon5 in
count_devices$ use_siw=1 ./check nvmeof-mp/001 nvmeof-mp/001 (Log in and log out) [failed] runtime 3.695s ... 4.002s --- tests/nvmeof-mp/001.out 2021-09-12 05:35:17.866892187 -0400 +++ /root/blktests/results/nodev/nvmeof-mp/001.out.bad 2021-09-12 06:49:25.621880616 -0400 @@ -1,3 +1,3 @@ Configured NVMe target driver -count_devices(): 1 <> 1 +count_devices(): 3 <> 1 Passed $ ls -l /sys/class/nvme-fabrics/ctl/*/*/device lrwxrwxrwx. 1 root root 0 Sep 12 06:49 /sys/class/nvme-fabrics/ctl/nvme0/hwmon5/device -> ../../nvme0 lrwxrwxrwx. 1 root root 0 Sep 12 06:49 /sys/class/nvme-fabrics/ctl/nvme0/ng0n1/device -> ../../nvme0 lrwxrwxrwx. 1 root root 0 Sep 12 06:49 /sys/class/nvme-fabrics/ctl/nvme0/nvme0n1/device -> ../../nvme0Signed-off-by Yi Zhang <[email protected]>--- tests/nvmeof-mp/001 | 1 + 1 file changed, 1 insertion(+)tests/nvmeof-mp/001 +0
-0
tests/nvmeof-mp/001 count_devices() { · line 14
Quoted 4 lines
tests/nvmeof-mp/001 +1
-0@@ -11,6 +11,7 @@ count_devices() { local d devs=0 for d in /sys/class/nvme-fabrics/ctl/*/*/device; do + [[ "$d" =~ hwmon[0-9]|ng[0-9]n[0-9] ]] && continue
I'm not too familiar with NVME_HWMON, but presumably it's possible to have more than 10 of these "ng" devices. Should this be ng[0-9]+n[0-9]?
Quoted 6 lines
tests/nvmeof-mp/001 +0
-0[ -d "$d" ] && ((devs++)) done echo "$devs"Signature · 1 line
2.21.3