[pve-devel] [PATCH storage 2/2] zfs: rollback: improve error message

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Sep 22 08:56:13 CEST 2020


we don't even know whether $snap exists at all, so the old variant could
be rather misleading..

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/Storage/ZFSPoolPlugin.pm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 6fa9127..7c180ea 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -476,9 +476,8 @@ sub volume_rollback_is_possible {
     die "can't rollback, no snapshots exist at all\n"
 	if !defined($recentsnap);
 
-    if ($snap ne $recentsnap) {
-	die "can't rollback, more recent snapshots exist\n";
-    }
+    die "can't rollback, '$snap' is not most recent snapshot\n"
+	if $snap ne $recentsnap;
 
     return 1;
 }
-- 
2.20.1





More information about the pve-devel mailing list