]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
tree: do not issue an error when subsys lookup fails during scanning
authorDaniel Wagner <dwagner@suse.de>
Tue, 6 Feb 2024 13:06:10 +0000 (14:06 +0100)
committerDaniel Wagner <wagi@monom.org>
Wed, 7 Feb 2024 11:26:57 +0000 (12:26 +0100)
The scan operation is not atomically done and the sysfs might change
while we are iterating over it. Thus, it's possible that we find a
controller but when we try to lookup the corresponding subsystem it might
already destroyed and removed.

This error makes blktests fail because it finds controllers controller
which are not under control of blktests, instead they are created and
destroyed by the udev auto connect rules.

These resources appear and disappear while the test runs but when we
scan sysfs we issue errors for unrelated resources. Thus just do not
issue a error, turn this into debug log message.

Anyway, we already do just return error codes for other reason in this
function anyway without logging.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
src/nvme/tree.c

index 024249eafe8d4b3e1b1014be8878e8c97e278025..344f8bc7fd74209e965caf8cfab0b44b02dab8e9 100644 (file)
@@ -2010,7 +2010,7 @@ nvme_ctrl_t nvme_scan_ctrl(nvme_root_t r, const char *name)
        }
        subsysname = nvme_ctrl_lookup_subsystem_name(r, name);
        if (!subsysname) {
-               nvme_msg(r, LOG_ERR,
+               nvme_msg(r, LOG_DEBUG,
                         "failed to lookup subsystem for controller %s\n",
                         name);
                errno = ENXIO;