From 3f89041df7727a488e2e65485aee7ee047b2bc7b Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 6 Feb 2024 14:06:10 +0100 Subject: [PATCH] tree: do not issue an error when subsys lookup fails during scanning 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 --- src/nvme/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvme/tree.c b/src/nvme/tree.c index 024249ea..344f8bc7 100644 --- a/src/nvme/tree.c +++ b/src/nvme/tree.c @@ -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; -- 2.50.1