public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH storage] lvm plugin: snapshot: don't quietly ignore failure to rename back to original
@ 2026-09-16 13:22 Fiona Ebner
  0 siblings, 0 replies; only message in thread
From: Fiona Ebner @ 2026-09-16 13:22 UTC (permalink / raw)
  To: pve-devel

In case the new top volume cannot be allocated, an error for renaming
back to the original name was quietly ignored. Log it as a task
warning, because this is important.

Signed-off-by: Fiona Ebner <f.ebner@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 67ba0f7..62f7997 100644
--- a/src/PVE/Storage/LVMPlugin.pm
+++ b/src/PVE/Storage/LVMPlugin.pm
@@ -9,6 +9,7 @@ use IO::File;
 use JSON;
 
 use PVE::JSONSchema qw(get_standard_option);
+use PVE::RESTEnvironment qw(log_warn);
 use PVE::Tools qw(run_command file_read_firstline trim);
 
 use PVE::Storage::Common;
@@ -1136,9 +1137,9 @@ my sub volume_snapshot_locked {
     die "error rename $volname to $snap - $@\n" if $@;
 
     eval { alloc_snap_image($class, $storeid, $scfg, $volname, $snap) };
-    if ($@) {
-        my $err = $@;
+    if (my $err = $@) {
         eval { $class->rename_snapshot($scfg, $storeid, $volname, $snap, 'current') };
+        log_warn("unable to rename $snap back to to $volname - $@") if $@;
         die $err;
     }
 }
-- 
2.47.3





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-16 13:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 13:22 [PATCH storage] lvm plugin: snapshot: don't quietly ignore failure to rename back to original Fiona Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal