Skip to content

Commit 8a4df2b

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 <[email protected]>
1 parent 0d6e855 commit 8a4df2b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libnvme/src/nvme/tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ static int nvme_scan_subsystem(struct nvme_global_ctx *ctx, const char *name)
922922
continue;
923923
if (strcmp(_s->name, name))
924924
continue;
925-
if (!nvme_subsystem_scan_namespaces(ctx, _s))
925+
if (nvme_subsystem_scan_namespaces(ctx, _s))
926926
return -EINVAL;
927927
s = _s;
928928
}
@@ -941,7 +941,7 @@ static int nvme_scan_subsystem(struct nvme_global_ctx *ctx, const char *name)
941941
s = nvme_alloc_subsystem(h, name, subsysnqn);
942942
if (!s)
943943
return -ENOMEM;
944-
if (!nvme_subsystem_scan_namespaces(ctx, s))
944+
if (nvme_subsystem_scan_namespaces(ctx, s))
945945
return -EINVAL;
946946
} else if (strcmp(s->subsysnqn, subsysnqn)) {
947947
nvme_msg(ctx, LOG_DEBUG, "NQN mismatch for subsystem '%s'\n",

0 commit comments

Comments
 (0)