]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: make sure to recheck current udev tag "systemd" before considering a device...
authorLennart Poettering <lennart@poettering.net>
Thu, 13 Dec 2018 17:32:03 +0000 (18:32 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Sep 2020 15:40:12 +0000 (17:40 +0200)
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

index 5b8134159a87c80deefb5335d679cab3ddf377c6..53bc549bd3692a5ded5e785261c1f1c88d083bc7 100644 (file)
@@ -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;