]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/udev/udev-event.c
udev,sd_device: also save map from device ID to watch handle in /run/udev/watch
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 7 Mar 2021 06:35:33 +0000 (15:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 30 Apr 2021 10:41:41 +0000 (19:41 +0900)
commite7f781e473f5119bf9246208a6de9f6b76a39c5d
tree80ce166a1fea649dc0b61efcf32c54d4027619cf
parent5e0d05106747d2ee25ce19a51ed8a5669ea93bf9
udev,sd_device: also save map from device ID to watch handle in /run/udev/watch

Previously, watch handle is saved in the udev databse. But in most cases,
the handle saved in the database is not updated. Especially, when udevd
is restarted, the inotify watch is restarted, but the database is not
updated.

Moreover, it is not necessary to save watch handle in the database, as
the handle is only take a effect during udevd is running, and the value
is meaningless when udevd is restarted.

So, this makes the opposite map from device ID to watch handle is saved
in /run/udev/watch as a symbolic link, and the handle not saved in the
database anymore.

Fixes #18525.
src/libsystemd/sd-device/device-private.c
src/libsystemd/sd-device/device-private.h
src/libsystemd/sd-device/sd-device.c
src/udev/udev-event.c
src/udev/udev-watch.c
src/udev/udev-watch.h
src/udev/udevd.c