Storage: Fix ZFS zvol activation race when mounting a temporary XFS snapshot for export#17162
Merged
tomponline merged 2 commits intocanonical:mainfrom Dec 4, 2025
Merged
Conversation
…temporary volume in mountVolumeSnapshot Otherwise it won't be readable from the caller. This was causing intermittent I/O failures doing `lxc export` when using zfs.block_mode with xfs. Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
…mDataset in mountVolumeSnapshot This fixes a race where LXD was not waiting long enough for the zvol to appear after activating it. Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a race condition that occurs when mounting temporary XFS snapshots for export in ZFS storage. The issue arises when the ZFS zvol block device hasn't yet appeared in /dev/ after being created, causing subsequent operations to fail.
Key Changes:
- Replaced immediate call to
getVolumeDiskPathFromDatasetwith a retry-capabletryGetVolumeDiskPathFromDatasetthat polls for the zvol device with a 30-second timeout - Removed the deferred
volmode=nonecleanup that could fail if the device hadn't appeared yet
simondeziel
approved these changes
Dec 4, 2025
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.
Fixes errors like: