New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stale devlink device units are not cleaned up while dispatching UDEV change events #24518
Comments
|
Sorry, v239 is too old here. Please reproduce the issue with recent release (v250 or v251) or the current git HEAD. IIRC, the issue was already fixed. |
|
[Canned reply follows] This is the upstream bug and feature request tracker of systemd. Please use this only for issues in the two most current upstream systemd versions. See this link for the list of current releases. https://github.com/systemd/systemd/releases For support for older versions please contact your distribution instead. In order to keep frustration at a minimum the submission form tried to make this all very clear. |
|
The issue is still partially reproducible on Fedora 36 with systemd With |
|
I tested with the current git HEAD, and reproduced the issue (but cannot with |
|
Great, thanks @yuwata! |
Previously, existing device units for devlinks were not removed unless the main device unit is removed. This makes all existing device units for devlinks are checked if they are still required, and remove if not necessary anymore. Fixes systemd#24518.
Previously, existing device units for devlinks were not removed unless the main device unit is removed. This makes all existing device units for devlinks are checked if they are still required, and remove if not necessary anymore. Fixes systemd#24518.
Previously, existing device units for devlinks were not removed unless the main device unit is removed. This makes all existing device units for devlinks are checked if they are still required, and remove if not necessary anymore. Fixes systemd#24518.
Previously, existing device units for devlinks were not removed unless the main device unit is removed. This makes all existing device units for devlinks are checked if they are still required, and remove if not necessary anymore. Fixes systemd#24518.
Previously, existing device units for devlinks were not removed unless the main device unit is removed. This makes all existing device units for devlinks are checked if they are still required, and remove if not necessary anymore. Partially fixes systemd#24518.
This is the continuation for the previous commit. Previously, device units created based on the SYSTEMD_ALIAS udev property were never removed unless their main device unit is removed. This makes the alias device units are checked if they are still required, and remove them if not necessary anymore. Fixes systemd#24518.
This is the continuation for the previous commit. Previously, device units created based on the SYSTEMD_ALIAS udev property were never removed unless their main device unit is removed. This makes the alias device units are checked if they are still required, and remove them if not necessary anymore. Fixes systemd#24518.
Previously, existing device units for devlinks were not removed unless the main device unit is removed. This makes all existing device units for devlinks are checked if they are still required, and remove if not necessary anymore. Partially fixes systemd#24518.
This is the continuation for the previous commit. Previously, device units created based on the SYSTEMD_ALIAS udev property were never removed unless their main device unit is removed. This makes the alias device units are checked if they are still required, and remove them if not necessary anymore. Fixes systemd#24518.
Previously, existing device units for devlinks were not removed unless the main device unit is removed. This makes all existing device units for devlinks are checked if they are still required, and remove if not necessary anymore. Partially fixes systemd#24518.
This is the continuation for the previous commit. Previously, device units created based on the SYSTEMD_ALIAS udev property were never removed unless their main device unit is removed. This makes the alias device units are checked if they are still required, and remove them if not necessary anymore. Fixes systemd#24518.
Previously, existing device units for devlinks or aliases were not removed unless the main device unit is removed. This makes all existing device units for devlinks and aliases are checked if they are still required, and remove if not necessary anymore. Fixes systemd#24518.
systemd version the issue has been seen with
239-58.el8_6.4 (appears to affect
main)Used distribution
AlmaLinux 8
Linux kernel version used
4.18.0-372.19.1.el8_6.x86_64
CPU architectures issue was seen on
x86_64
Component
systemd
Expected behaviour you didn't see
Systemd should remove stale devlinks device units while dispatching UDEV "change" events for the parent device (e.g. when renaming an LVM Logical Volume).
Unexpected behaviour you saw
Currently systemd will create new device units for any new paths appearing in devlinks in a UDEV change event, but will not remove previously-created device units for paths which are no longer present in devlinks. This leaves device units for non-existent paths hanging around until the parent device is removed.
Further, if a daemon-reload is issued before the parent device unit is removed, the stale devlinks units lose their association with the parent device (through matching syspath) during device enumeration because the paths no longer exist, leaving them hanging around for ever (until rebooting).
Although I tested with 239-58.el8_6.4 on AlmaLinux 8, after checking over
src/core/device.c, this still appears to affectmain; there doesn't appear to be any special handling for the "change" event case.Steps to reproduce the problem
Create a new Logical Volume:
The following related units are created:
Rename the previously-created LV:
The following paths no longer exist as a result:
Yet the following related device units now exist:
At this point, deleting the parent device (e.g. with
lvremove /dev/test/test-a-2) will still result in all the associated devlinks device units being correctly removed (including the stale ones).However, if a daemon-reload is issued before removing the parent device, the stale devlinks devices lose their association with the parent:
Removing the parent device then leaves those dangling units behind:
The dangling units survive a daemon-reexec. Only a reboot will clean them up.
Additional program output to the terminal or log subsystem illustrating the issue
No response
The text was updated successfully, but these errors were encountered: