zfs: handle unexpectedly missing snapshots better

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2020-09-22 08:56:12 +02:00
committed by Thomas Lamprecht
parent 48d0cd02c1
commit c8eb017867

View File

@ -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";
}