]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: downgrade log level when device node is already removed
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 17 Sep 2022 21:03:14 +0000 (06:03 +0900)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 18 Sep 2022 08:51:25 +0000 (10:51 +0200)
Follow-up for 790da548b0c37af60aed2f46867ba3885ea78718.

src/udev/udev-event.c

index 7bff3115439a1706a45b9428610d5139b0f6b193..d4622b2f9d827b99a17ba779c147928bbeb2ce81 100644 (file)
@@ -1163,6 +1163,7 @@ void udev_event_process_inotify_watch(UdevEvent *event, int inotify_fd) {
                 return;
 
         r = udev_watch_begin(inotify_fd, dev);
-        if (r < 0)
-                log_device_warning_errno(dev, r, "Failed to add inotify watch, ignoring: %m");
+        if (r < 0) /* The device may be already removed, downgrade log level in that case. */
+                log_device_full_errno(dev, r == -ENOENT ? LOG_DEBUG : LOG_WARNING, r,
+                                      "Failed to add inotify watch, ignoring: %m");
 }