Skip to content

Commit 01116ad

Browse files
martin-gpyigaw
authored andcommitted
tree: fix nvme_subsystem_scan_namespaces() return handling
nvme list-subsys with the -vv option currently displays the following: scan controller nvme0 lookup subsystem /sys/class/nvme-subsystem/nvme-subsys0/nvme0 scan controller nvme0 path nvme0c0n1 scan subsystem nvme-subsys0 scan subsystem nvme-subsys0 namespace nvme0n1 failed to scan subsystem nvme-subsys0: Invalid argument ... The invalid argument seen above is due to the wrong return handling of nvme_subsystem_scan_namespaces() in nvme_scan_subsystem(). Fix the same. Signed-off-by: Martin George <marting@netapp.com> (upstream nvme-cli commit 8a4df2bc2c66ac403b11902708aec622fa07bf0e) Signed-off-by: Daniel Wagner <wagi@kernel.org>
1 parent 9fd6153 commit 01116ad

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/nvme/tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ static int nvme_scan_subsystem(struct nvme_root *r, const char *name)
883883
continue;
884884
if (strcmp(_s->name, name))
885885
continue;
886-
if (!nvme_subsystem_scan_namespaces(r, _s)) {
886+
if (nvme_subsystem_scan_namespaces(r, _s)) {
887887
errno = EINVAL;
888888
return -1;
889889
}
@@ -904,7 +904,7 @@ static int nvme_scan_subsystem(struct nvme_root *r, const char *name)
904904
errno = ENOMEM;
905905
return -1;
906906
}
907-
if (!nvme_subsystem_scan_namespaces(r, s)) {
907+
if (nvme_subsystem_scan_namespaces(r, s)) {
908908
errno = EINVAL;
909909
return -1;
910910
}

0 commit comments

Comments
 (0)