summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-05-26 18:58:15 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-05-31 07:05:13 +0200
commitbed695375abc5b27213adcaea0eb37655d48f58e (patch)
treeb14c3b51f5f83c5babad82f6b17b520662a8ce27
parent66fcfdfde7d98413cc8f68a98e56fe36f5d9cc38 (diff)
downloadsystemd-bed695375abc5b27213adcaea0eb37655d48f58e.tar.gz
udev: when the BSD lock on a block device is taken, don't complain
if someone implements https://systemd.io/BLOCK_DEVICE_LOCKING/ then we shouldn't loudly complain about that. This reverts back to the original behaviour from 3ebdb81ef088afd3b4c72b516beb5610f8c93a0d: when the lock is taken we silently skip processing the device and sending out the messages for it. (cherry picked from commit 5abee64ed40039404d68414f0189245988635e6c)
-rw-r--r--src/udev/udevd.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 4d69f49e1a..2ac1cac970 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -443,13 +443,18 @@ static int worker_device_monitor_handler(sd_device_monitor *monitor, sd_device *
assert(manager);
r = worker_process_device(manager, dev);
- if (r < 0)
- log_device_warning_errno(dev, r, "Failed to process device, ignoring: %m");
+ if (r == -EAGAIN)
+ /* if we couldn't acquire the flock(), then proceed quietly */
+ log_device_debug_errno(dev, r, "Device currently locked, not processing.");
+ else {
+ if (r < 0)
+ log_device_warning_errno(dev, r, "Failed to process device, ignoring: %m");
- /* send processed event back to libudev listeners */
- r = device_monitor_send_device(monitor, NULL, dev);
- if (r < 0)
- log_device_warning_errno(dev, r, "Failed to send device, ignoring: %m");
+ /* send processed event back to libudev listeners */
+ r = device_monitor_send_device(monitor, NULL, dev);
+ if (r < 0)
+ log_device_warning_errno(dev, r, "Failed to send device, ignoring: %m");
+ }
/* send udevd the result of the event execution */
r = worker_send_message(manager->worker_watch[WRITE_END]);