Open
Conversation
added 2 commits
February 26, 2026 09:59
Separate device offline and delete operations to prevent udev from re-adding devices during cleanup. Add deactivation callback mechanism to ensure proper sequencing between volume disconnection and device node removal. Improve error handling in device operations.
amulet1
reviewed
Feb 26, 2026
| $logger->( P_WARN, "Kernel rejected '$value' for $path (EINVAL). Device may be busy, mounted, or driver doesn't support this transition.", undef ); | ||
| return; | ||
| } | ||
| $logger->( P_WARN, "Critical failure writing to $path: $err", undef ); |
Collaborator
There was a problem hiding this comment.
close( $ fh ) could be called twice.
amulet1
requested changes
Feb 26, 2026
|
|
||
| sub unmap_volume { | ||
| my ( $class, $storeid, $scfg, $volname, $snapname ) = @_; | ||
| my ( $class, $storeid, $scfg, $volname, $deactivate_cb ) = @_; |
Collaborator
There was a problem hiding this comment.
unmap_volume (and few other plugin methods) is called by PVE::Storage:
sub unmap_volume {
my ($cfg, $volid, $snapname) = @_;
my ($storeid, $volname) = parse_volume_id($volid);
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
return $plugin->unmap_volume($storeid, $scfg, $volname, $snapname);
}You should not change its signature.
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.
Summary
Fixes race condition in volume unmap/remove operations (#88) where iscsid rescans re-add device paths after removal but
before deactivation.
Changes
• Split device cleanup into offline and delete phases to prevent udev re-adding devices.
• Added deactivation callback mechanism to unmap_volume for proper sequencing.
• Updated deactivate_volume to disconnect volume after offlining devices.
• Improved error handling in device operations.
Testing Plan
• Verify volume unmap/remove operations complete without device path failures.
• Test with multipath-enabled volumes.
• Confirm no "Logical unit not supported" errors in logs.