From 242c1c075aa284c8a8657c5aca36147f528146ba Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 13 Dec 2018 18:32:03 +0100 Subject: [PATCH] core: make sure to recheck current udev tag "systemd" before considering a device ready Let's ensure that a device once tagged can become active/inactive simply by toggling the current tag. Note that this means that a device once tagged with "systemd" will always have a matching .device unit. However, the active/inactive state of the unit reflects whether it is currently tagged that way (and doesn't have SYSTEMD_READY=0 set). Fixes: #7587 --- src/core/device.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/device.c b/src/core/device.c index 5b8134159a8..53bc549bd36 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -736,6 +736,10 @@ static bool device_is_ready(sd_device *dev) { if (device_is_renaming(dev) > 0) return false; + /* Is it really tagged as 'systemd' right now? */ + if (sd_device_has_current_tag(dev, "systemd") <= 0) + return false; + if (sd_device_get_property_value(dev, "SYSTEMD_READY", &ready) < 0) return true; -- 2.47.3