udevadm: cleanup-db: don't delete information for kept db entries
authorMartin Wilck <mwilck@suse.com>
Thu, 20 Jan 2022 13:31:45 +0000 (14:31 +0100)
committerMartin Wilck <mwilck@suse.com>
Fri, 21 Jan 2022 12:32:20 +0000 (13:32 +0100)
commit7ec624147a41d80f8e492c9fe19a24e2cda58c25
tree1aca97651fd5490d4f7faf218edbdd67c655274d
parent28d6e8545151d413f8614db9fa790f9f9edbb045
udevadm: cleanup-db: don't delete information for kept db entries

devices with the db_persist property won't be deleted during database
cleanup. This applies to dm and md devices in particular.
For such devices, we should also keep the files under /run/udev/links,
/run/udev/tags, and /run/udev/watch, to make sure that after restart,
udevd has the same information about the devices as it did before
the cleanup.

If we don't do this, a lower-priority device that is discovered in
the coldplug phase may take over symlinks from a device that persisted.
Not removing the watches also enables udevd to resume watching a device
after restart.

Signed-off-by: Martin Wilck <mwilck@suse.com>
src/udev/udevadm-info.c