Files
debos/actions
Sjoerd Simons 1002e0a339 image-partition: Minimize the image lock scope
Newer systemd/udev versions will delay processing events for block
devices if another process holds an exclusive file lock, which is meant to
improve coordination with e.g. partitioners.

This also means `udevadm settle` will block until it hits a timeout if
being called while a lock is held. Which happens with the current debos
locking scheme (holding the lock for all paritioning operations) due to
Debians parted running `udevadm settle` after committing partition
changes.

However the debos current locking will equivalently be problematic when
partitioning tools will take over systemds device locking
recommendations as they'll want to flock the device themselves.

To fix both current and future issues change the debos locking scheme to
*only* hold an exclusive lock for operations using the partition devices
(formatting and mounting) to avoid udev triggering partition table
rescans and devices disappearing when debos actually wants to use them.

Fixes: #344
See: https://systemd.io/BLOCK_DEVICE_LOCKING/
Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2022-10-15 09:47:32 +02:00
..