[pve-devel] [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better

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


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

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 10354b3..6fa9127 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -472,6 +472,10 @@ sub volume_rollback_is_possible {
     my ($class, $scfg, $storeid, $volname, $snap) = @_;
 
     my $recentsnap = $class->zfs_get_latest_snapshot($scfg, $volname);
+
+    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";
     }
-- 
2.20.1






More information about the pve-devel mailing list