summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-watch.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-11-13 14:53:04 +0100
committerLennart Poettering <lennart@poettering.net>2018-11-13 22:02:55 +0100
commit7fe0d0d5c0ad5aa3f069bb282868938d414d7ad1 (patch)
treee5d80089194e6bce74b4ac0a89a76f27ab38db33 /src/udev/udev-watch.c
parentcore: use local variable m instead of u->manager (diff)
downloadsystemd-7fe0d0d5c0ad5aa3f069bb282868938d414d7ad1.tar.xz
systemd-7fe0d0d5c0ad5aa3f069bb282868938d414d7ad1.zip
udev: downgrade message when we fail to set inotify watch up
My logs are full of: systemd-udevd[6586]: seq 13515 queued, 'add' 'block' systemd-udevd[6586]: seq 13516 queued, 'change' 'block' systemd-udevd[6586]: seq 13517 queued, 'change' 'block' systemd-udevd[6586]: seq 13518 queued, 'remove' 'bdi' systemd-udevd[6586]: seq 13519 queued, 'remove' 'block' systemd-udevd[9865]: seq 13514 processed systemd-udevd[9865]: seq 13515 running systemd-udevd[9865]: GROUP 6 /usr/lib/udev/rules.d/50-udev-default.rules:59 systemd-udevd[9865]: IMPORT builtin 'blkid' /usr/lib/udev/rules.d/60-persistent-storage.rules:95 systemd-udevd[9865]: IMPORT builtin 'blkid' fails: No such file or directory systemd-udevd[9865]: loop4: Failed to add device '/dev/loop4' to watch: No such file or directory (the last line is at error level). If we are too slow to set up a watch and the device is already gone by the time we try, this is not an error.
Diffstat (limited to 'src/udev/udev-watch.c')
-rw-r--r--src/udev/udev-watch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c
index cf2faa0831..3f8715709a 100644
--- a/src/udev/udev-watch.c
+++ b/src/udev/udev-watch.c
@@ -95,7 +95,10 @@ int udev_watch_begin(sd_device *dev) {
log_device_debug(dev, "Adding watch on '%s'", devnode);
wd = inotify_add_watch(inotify_fd, devnode, IN_CLOSE_WRITE);
if (wd < 0)
- return log_device_error_errno(dev, errno, "Failed to add device '%s' to watch: %m", devnode);
+ return log_device_full(dev,
+ errno == ENOENT ? LOG_DEBUG : LOG_ERR,
+ errno,
+ "Failed to add device '%s' to watch: %m", devnode);
device_set_watch_handle(dev, wd);