public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better
@ 2020-09-22  6:56 Fabian Grünbichler
  2020-09-22  6:56 ` [pve-devel] [PATCH storage 2/2] zfs: rollback: improve error message Fabian Grünbichler
  2020-09-23 13:11 ` [pve-devel] applied-series: [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2020-09-22  6:56 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Fabian Grünbichler <f.gruenbichler@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH storage 2/2] zfs: rollback: improve error message
  2020-09-22  6:56 [pve-devel] [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better Fabian Grünbichler
@ 2020-09-22  6:56 ` Fabian Grünbichler
  2020-09-23 13:11 ` [pve-devel] applied-series: [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2020-09-22  6:56 UTC (permalink / raw)
  To: pve-devel

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@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied-series: [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better
  2020-09-22  6:56 [pve-devel] [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better Fabian Grünbichler
  2020-09-22  6:56 ` [pve-devel] [PATCH storage 2/2] zfs: rollback: improve error message Fabian Grünbichler
@ 2020-09-23 13:11 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2020-09-23 13:11 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Grünbichler

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

applied both patches, thanks!





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-23 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22  6:56 [pve-devel] [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better Fabian Grünbichler
2020-09-22  6:56 ` [pve-devel] [PATCH storage 2/2] zfs: rollback: improve error message Fabian Grünbichler
2020-09-23 13:11 ` [pve-devel] applied-series: [PATCH storage 1/2] zfs: handle unexpectedly missing snapshots better Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal