summaryrefslogtreecommitdiff
path: root/src/udev
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
parent8724defeae4c6da9e5816e88dec4138c5f909932 (diff)
downloadsystemd-7fe0d0d5c0ad5aa3f069bb282868938d414d7ad1.tar.gz
systemd-7fe0d0d5c0ad5aa3f069bb282868938d414d7ad1.tar.bz2
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')
-rw-r--r--src/udev/udev-watch.c5
-rw-r--r--src/udev/udevd.c2
2 files changed, 5 insertions, 2 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);
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 05030dc81e..354910e684 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -456,7 +456,7 @@ static void worker_spawn(Manager *manager, struct event *event) {
/* apply/restore inotify watch */
if (udev_event->inotify_watch) {
- udev_watch_begin(dev->device);
+ (void) udev_watch_begin(dev->device);
udev_device_update_db(dev);
}