Repository navigation
udev: do not skip events when device is already locked - #22717
Conversation
8c4d199 to
dd5d942
Compare
dd5d942 to
97c044c
Compare
c60c8c5 to
b078d7c
Compare
|
Now TEST-46-HOMED becomes quite unstable (but it was already unstable): But this is a lock for regular file, and should not be (at least directly) related to this PR. I guess there is a race or fd leak in homed or homework. @poettering Could you take a look https://jenkins-systemd.apps.ocp.ci.centos.org/job/upstream-vagrant-archlinux/10518/artifact/systemd-centos-ci/artifacts_lbwk7s93/vagrant-logs.Pqn/vagrant-arch-testsuite.Orc/TEST-46-HOMED/system.journal ? |
|
Added two commits:
This is now ready for review. PTAL. |
|
It seems the whole story do not needs any updates. Only minor issue. See #22722. |
|
@mrc0mmand Could you run TEST-64 repeatedly with this PR on an affected CI env? |
Sure, unleashed systemd/systemd-centos-ci#474 on this PR. |
|
Hm, not only homed test, but the repart test becomes also unstable... |
48ab9bd to
bdd4bd8
Compare
|
@mrc0mmand Thanks. Could you re-trigger the CI in systemd/systemd-centos-ci#474? I hope the last failure is solved or at least mitigated. |
46c5e6a to
b867169
Compare
b867169 to
a0d8b3b
Compare
|
I noticed sd-makefs and sd-growfs do not flock block device... |
a0d8b3b to
360c5f0
Compare
…another process Previously, if a block device is locked by another process, then the corresponding worker skip to process the corresponding event, and does not broadcast the uevent to libudev listners. This causes several issues: - During a period of a device being locked by a process, if a user trigger an event with `udevadm trigger --settle`, then it never returned. - When there is a delay between close and unlock in a process, then the synthesized events triggered by inotify may not be processed. This can happens easily by wrapping mkfs with flock. This causes severe issues e.g. new devlinks are not created, or old devlinks are not removed. This commit makes events are requeued with a tiny delay when the corresponding block devices are locked by other processes. With this way, the triggered uevent may be delayed but is always processed by udevd. Hence, the above issues can be solved. Also, it is not necessary to watch a block device unconditionally when it is already locked. Hence, the logic is dropped.
This also makes return value initialized when these function return 0 to follow our coding style. Just a preparation for later commits.
Then, hopefully, previously requeued events are processed earlier.
This reverts commit 95e3551.
As stated in systemd#21819 (comment) `mkfs.btrfs` doesn't hold the lock for the whole duration of `mkfs.btrfs`, thus causing unexpected races & test fails. Let's wrap the `mkfs.btrfs` calls in an flock wrapper to mitigate this. Hopefully fixes: systemd#21819
c4492b6 to
41d1aae
Compare
So, libudev listners can easily detect errors. Addresses systemd#22717 (comment).
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
So, libudev listners can easily detect errors. Addresses systemd#22717 (comment).
So, libudev listners can easily detect errors. Addresses systemd#22717 (comment).
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
So, libudev listners can easily detect errors. Addresses systemd#22717 (comment).
So, libudev listners can easily detect errors. Addresses systemd#22717 (comment).
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Prompted by systemd#22717 (comment). The new command 'udevadm wait' waits for device or device symlink being created. This may be useful to wait for a device is processed by udevd after e.g. formatting or partitioning the device.
Inspired by: systemd/systemd#22717 (comment) (cherry picked from commit 3f2ada8)
No description provided.