]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
nvme-print: fix wrong list-subsys output when ns are attached to different ctrls
authorSagi Grimberg <sagi@grimberg.me>
Mon, 12 Jun 2023 15:34:06 +0000 (18:34 +0300)
committerDaniel Wagner <dwagner@suse.de>
Wed, 14 Jun 2023 11:46:13 +0000 (13:46 +0200)
commit1cc057ae19c8bfaea0120a953a40aa18dfe3e027
tree4b37e39358c339f99b571eca27755b636ba748f5
parent6c826dfe8591215bae257eec6d82fee5b00ab4df
nvme-print: fix wrong list-subsys output when ns are attached to different ctrls

If we list subsystem controllers not for a specific ns (user did not pass
a namespace device node), we cannot look at the first ns in the subsystem
to list because it may not be attached to all subsystem controllers.

We incorrectly assumes that subsystem namespaces (or at least the first of
them) are attached to all subsystem controllers.

Fix that by showing the multipath subsystem-list flavor only when the user
passed a specific namespace, and fallback to a simple controller list otherwise.

Fixes: cdeaab8fca6e ("nvme-print: Show ANA state only for one namespace")
Fixes: 7435ed9ae6a6 ("nvme-print: Show paths from the first namespace only")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme-print-json.c
nvme-print-stdout.c