zfs: handle unexpectedly missing snapshots better
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
48d0cd02c1
commit
c8eb017867
@ -472,6 +472,10 @@ sub volume_rollback_is_possible {
|
|||||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||||
|
|
||||||
my $recentsnap = $class->zfs_get_latest_snapshot($scfg, $volname);
|
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) {
|
if ($snap ne $recentsnap) {
|
||||||
die "can't rollback, more recent snapshots exist\n";
|
die "can't rollback, more recent snapshots exist\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user