From c8eb017867c9dc5068826129b16133b7e99886f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 22 Sep 2020 08:56:12 +0200 Subject: [PATCH] zfs: handle unexpectedly missing snapshots better MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- 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"; }