[pve-devel] [PATCH storage 2/4] lvm plugin: fix error handling in volume_snapshot_rollback()
Fiona Ebner
f.ebner at proxmox.com
Mon Nov 3 17:23:13 CET 2025
In case a cleanup worker is spawned, the error from the eval block
for allocation was lost. Save it in a variable for checking later.
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
src/PVE/Storage/LVMPlugin.pm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
index 24f2534..f5a2008 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -1097,11 +1097,12 @@ sub volume_snapshot_rollback {
die "error deleting snapshot $snap $@\n" if $@;
eval { alloc_snap_image($class, $storeid, $scfg, $volname, $snap) };
+ my $alloc_err = $@;
fork_cleanup_worker($cleanup_worker);
- if ($@) {
- die "can't allocate new volume $volname: $@\n";
+ if ($alloc_err) {
+ die "can't allocate new volume $volname: $alloc_err\n";
}
return undef;
--
2.47.3
More information about the pve-devel
mailing list