]> www.infradead.org Git - users/sagi/libnvme.git/commit
tree: make nvme_subsystem_scan_namespace() idempotent
authorHannes Reinecke <hare@suse.de>
Fri, 10 Jun 2022 08:19:01 +0000 (10:19 +0200)
committerHannes Reinecke <hare@suse.de>
Fri, 10 Jun 2022 08:19:01 +0000 (10:19 +0200)
commit70946ce055892869730f9a19a0f0e73e85fbaa13
tree8ddb68536b28c32fa9501aabf1cea666936f0f26
parent5b5acce352a65ce9d8acd04f01b88732bd2daa2d
tree: make nvme_subsystem_scan_namespace() idempotent

When issuing a rescan the list of namespaces is not cleared, so
just blindly adding new entries might not yield the expected result.
This patch clears out old entries from the subsystem namespace list
before adding new ones, ensuring that we only ever have one namespace
with a given name in the list of subsystem namespaces.

Signed-off-by: Hannes Reinecke <hare@suse.de>
src/nvme/tree.c