incusd/storage/zfs: Rework zvol resolution logic#2673
Merged
Conversation
2744483 to
d4946bc
Compare
Signed-off-by: Stéphane Graber <[email protected]>
The previous logic was relying either on udev or on a slow crawl through /dev using the zvol_id utility. This was problematic not just because we could get into timeouts on systems with a LOT of volumes, but also because it was inherently racy. Udev works in the background, so entries may not show up immediately and if something goes wrong during cleanup, we can be left with a symlink pointing to the wrong /dev/zdXYZ device. This is very similar to the LVM issue we fixed a little while back where in the worst case scenario, it can lead to the wrong block device being accessed, causing corruption or potential data leakage. The new logic relies entirely on devtmpfs (not udev) and is optimized to try and hit the correct /dev/zdXYZ device almost immediately, limiting the performance impact on busy systems. Closes lxc#1505 Signed-off-by: Stéphane Graber <[email protected]>
This reverts commit ae53328. Signed-off-by: Stéphane Graber <[email protected]>
tomponline
added a commit
to canonical/lxd
that referenced
this pull request
Dec 3, 2025
…ncus) (#17095) Cherry-picks from lxc/incus#2673
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous logic was relying either on udev or on a slow crawl through /dev using the zvol_id utility.
This was problematic not just because we could get into timeouts on systems with a LOT of volumes, but also because it was inherently racy. Udev works in the background, so entries may not show up immediately and if something goes wrong during cleanup, we can be left with a symlink pointing to the wrong /dev/zdXYZ device.
This is very similar to the LVM issue we fixed a little while back where in the worst case scenario, it can lead to the wrong block device being accessed, causing corruption or potential data leakage.
The new logic relies entirely on devtmpfs (not udev) and is optimized to try and hit the correct /dev/zdXYZ device almost immediately, limiting the performance impact on busy systems.
Closes #1505