]> git.ipfire.org Git - thirdparty/systemd.git/commit
core/device: ignore DEVICE_FOUND_UDEV bit on switching root 23218/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 29 Apr 2022 11:29:11 +0000 (20:29 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 12 May 2022 18:04:31 +0000 (03:04 +0900)
commit75d7b5989f99125e52d5c0e5656fa1cd0fae2405
treef57b415f5e4fa976b3b361f11358b92125c7ba2e
parentf33bc87989a87475ed41bc9cd715c4cbb18ee389
core/device: ignore DEVICE_FOUND_UDEV bit on switching root

The issue #12953 is caused by the following:
On switching root,
- deserialized_found == DEVICE_FOUND_UDEV | DEVICE_FOUND_MOUNT,
- deserialized_state == DEVICE_PLUGGED,
- enumerated_found == DEVICE_FOUND_MOUNT,
On switching root, most devices are not found by the enumeration process.
Hence, the device state is set to plugged by device_coldplug(), and then
changed to the dead state in device_catchup(). So the corresponding
mount point is unmounted. Later when the device is processed by udevd, it
will be changed to plugged state again.

The issue #23208 is caused by the fact that generated udev database in
initramfs and the main system are often different.

So, the two issues have the same root; we should not honor
DEVICE_FOUND_UDEV bit in the deserialized_found on switching root.

This partially reverts c6e892bc0eebe1d42c282bd2d8bae149fbeba85f.

Fixes #12953 and #23208.
Replaces #23215.

Co-authored-by: Martin Wilck <mwilck@suse.com>
src/core/device.c