Systemd/src/systemd
Lennart Poettering e77b146f82 udev: make tags "sticky"
This tries to address the "bind"/"unbind" uevent kernel API breakage, by
changing the semantics of device tags.

Previously, tags would be applied on uevents (and the database entries
they result in) only depending on the immediate context. This means that
if one uevent causes the tag to be set and the next to be unset, this
would immediately effect what apps would see and the database entries
would contain each time. This is problematic however, as tags are a
filtering concept, and if tags vanish then clients won't hence notice
when a device stops being relevant to them since not only the tags
disappear but immediately also the uevents for it are filtered including
the one necessary for the app to notice that the device lost its tag and
hence relevance.

With this change tags become "sticky". If a tag is applied is once
applied to a device it will stay in place forever, until the device is
removed. Tags can never be removed again. This means that an app
watching a specific set of devices by filtering for a tag is guaranteed
to not only see the events where the tag is set but also all follow-up
events where the tags might be removed again.

This change of behaviour is unfortunate, but is required due to the
kernel introducing new "bind" and "unbind" uevents that generally have
the effect that tags and properties disappear and apps hence don't
notice when a device looses relevance to it. "bind"/"unbind" events were
introduced in kernel 4.12, and are now used in more and more subsystems.
The introduction broke userspace widely, and this commit is an attempt
to provide a way for apps to deal with it.

While tags are now "sticky" a new automatic device property
CURRENT_TAGS is introduced (matching the existing TAGS property) that
always reflects the precise set of tags applied on the most recent
events. Thus, when subscribing to devices through tags, all devices that
ever had the tag put on them will be be seen, and by CURRENT_TAGS it may
be checked whether the device right at the moment matches the tag
requirements.

See: #7587 #7018 #8221
2020-09-01 17:40:12 +02:00
..
_sd-common.h _sd-common.h: avoid parsing errors with Coverity 2020-08-06 16:26:57 +02:00
meson.build sd-dhcp6: Introduce vendor specific information 2020-05-29 13:36:42 +02:00
sd-bus-protocol.h tree-wide: drop empty lines in the begining of comments 2018-06-29 10:50:23 +09:00
sd-bus-vtable.h sd-bus: introduce new SD_BUS_VTABLE_ABSOLUTE_OFFSET vtable flag 2020-05-13 16:57:44 +02:00
sd-bus.h sd-bus: add a variant of sd_bus_error_has_name() that takes multiple names 2020-08-24 19:48:22 +02:00
sd-daemon.h Introduce sd_notify_barrier 2020-05-01 03:22:47 +05:30
sd-device.h udev: make tags "sticky" 2020-09-01 17:40:12 +02:00
sd-dhcp-client.h sd-dhcp-client: add sd_dhcp_client_id_to_string() 2020-06-04 11:16:15 +02:00
sd-dhcp-lease.h sd-dhcp: clean-up of DHCP lease server code 2020-05-30 14:18:43 +02:00
sd-dhcp-option.h dhcp: remove struct sd_dhcp_raw_option 2019-11-18 23:37:22 +09:00
sd-dhcp-server.h network: clean-up DHCP lease server data configuration 2020-06-18 13:08:18 +09:00
sd-dhcp6-client.h network: DHCP6 - introduce DHCP6 DUID to string 2020-06-10 19:17:28 +02:00
sd-dhcp6-lease.h dhcp6: parse the FQDN option 2020-08-03 09:36:18 +02:00
sd-dhcp6-option.h sd-dhcp6: Introduce vendor specific information 2020-05-29 13:36:42 +02:00
sd-event.h sd-event: add relative timer calls 2020-07-28 11:23:41 +02:00
sd-hwdb.h tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
sd-id128.h tree-wide: drop duplicated blank lines 2019-07-15 18:41:27 +02:00
sd-ipv4acd.h ipv4ll: do not reset conflict counter on restart 2019-12-11 13:26:31 +09:00
sd-ipv4ll.h tree-wide: use proper unicode © instead of (C) where we can 2018-06-14 10:20:20 +02:00
sd-journal.h sd-journal: when enumerating, continue even after an inaccessible field 2020-07-21 17:42:11 +02:00
sd-lldp.h all: fix minor typos 2020-07-07 18:52:49 +09:00
sd-login.h sd-login: get rid of seat_can_multi_session() 2020-04-17 16:15:30 +02:00
sd-messages.h udevadm: beef up deprecation log warning 2020-07-14 14:57:19 +02:00
sd-ndisc.h tree-wide: fix spelling errors 2020-04-21 23:21:08 +02:00
sd-netlink.h sd-netlink: introduce sd_netlink_message_append_s8() and friends 2020-03-02 15:59:32 +09:00
sd-network.h sd-network: drop unused functions 2020-06-23 19:13:05 +09:00
sd-path.h sd-path: drop "-dir" and "-path" suffixes from path enums 2020-05-28 23:54:35 +02:00
sd-radv.h radv: introduce sd_radv_is_running() 2020-07-20 15:29:12 +09:00
sd-resolve.h tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
sd-utf8.h tree-wide: drop empty lines in the begining of comments 2018-06-29 10:50:23 +09:00