On current kernels (5.8 for example) under some conditions I don't fully grok it might happen that a detached loopback block device still has partition block devices around. Accessing these partition block devices results in EIO errors (that also fill up dmesg). These devices cannot be claned up with LOOP_CLR_FD (since the main device already is officially detached), nor with LOOP_CTL_DELETE (returns EBUSY as long as the partitions still exist). This is a kernel bug. But it appears to apply to all recent kernels. I cannot really pin down what triggers this, suffice to say our heavy-duty test can trigger it. Either way, let's do something about it: when we notice this state we'll attach an empty file to it, which is guaranteed to have to part table. This makes the partitions go away. After closing/reoping the device we hence are good to go again. ugly workaround, but I think OK enough to use. The net result is: with this commit, we'll guarantee that by the time we attach a file to the loopback device we have zero kernel partitions associated with it. Thus if we then wait for the kernel partitions we need to appear we should have entirely reliable behaviour even if loopback devices by the name are heavily recycled and udev events reach us very late. Fixes: #16858
System and Service Manager
Details
Most documentation is available on systemd's web site.
Assorted, older, general information about systemd can be found in the systemd Wiki.
Information about build requirements is provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the Hacking guide for information on how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Stable branches with backported patches are available in the stable repo.