public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone with refquota=none
@ 2026-07-06  9:40 Fiona Ebner
  2026-07-06  9:40 ` [PATCH storage 1/3] zfspool plugin: fix regression for rollback " Fiona Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-07-06  9:40 UTC (permalink / raw)
  To: pve-devel

As reported in the community forum [0], rollback of a container with a
ZFS dataset with 'refquota=none' would fail. Similarly, cloning such a
container would fail as well. The reason is that ZFS does not accept a
0 value for the refquota property, but returns 0 when queried with -p.

[0]: https://forum.proxmox.com/threads/184113/

pve-storage:

Fiona Ebner (3):
  zfspool plugin: fix regression for rollback with refquota=none
  zfspool plugin: clone image: use zfs_get_properties() helper
  zfspool plugin: clone: fix linked clone of container subvol with
    refquota=none

 src/PVE/Storage/ZFSPoolPlugin.pm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)


Summary over all repositories:
  1 files changed, 4 insertions(+), 5 deletions(-)

-- 
Generated by git-murpp 0.5.0




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

* [PATCH storage 1/3] zfspool plugin: fix regression for rollback with refquota=none
  2026-07-06  9:40 [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone with refquota=none Fiona Ebner
@ 2026-07-06  9:40 ` Fiona Ebner
  2026-07-06  9:40 ` [PATCH storage 2/3] zfspool plugin: clone image: use zfs_get_properties() helper Fiona Ebner
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-07-06  9:40 UTC (permalink / raw)
  To: pve-devel

As reported in the community forum [0], rollback of a container with a
ZFS dataset with 'refquota=none' would fail. Since commit a9315a0
("fix #6561: zfspool: track refquota for subvolumes via user
properties"), when creating a snapshot, the current refquota is saved
as a user property on the snapshot. The value is queried with '-p' to
get the exact parsable value. In case of 'none', it will be returned
as 0. However, 'zfs set' does not accept an explicit 0 value, but
requires 'none', so restoring the refquota from the user property upon
rollback would fail. Special case the value 0 to fix the issue.

[0]: https://forum.proxmox.com/threads/184113/

Fixes: a9315a0 ("fix #6561: zfspool: track refquota for subvolumes via user properties")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/Storage/ZFSPoolPlugin.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/Storage/ZFSPoolPlugin.pm b/src/PVE/Storage/ZFSPoolPlugin.pm
index 8630744..0531a5d 100644
--- a/src/PVE/Storage/ZFSPoolPlugin.pm
+++ b/src/PVE/Storage/ZFSPoolPlugin.pm
@@ -562,6 +562,7 @@ sub volume_snapshot_rollback {
         my $refquota = $class->zfs_get_properties($scfg, 'pve-storage:refquota', $snapshot_name);
 
         if ($refquota =~ m/^\d+$/) {
+            $refquota = 'none' if $refquota == 0; # zfs does not accept 0 for refquota property
             $class->zfs_request(
                 $scfg, undef, 'set', "refquota=${refquota}", "$scfg->{pool}/$vname",
             );
-- 
2.47.3





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

* [PATCH storage 2/3] zfspool plugin: clone image: use zfs_get_properties() helper
  2026-07-06  9:40 [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone with refquota=none Fiona Ebner
  2026-07-06  9:40 ` [PATCH storage 1/3] zfspool plugin: fix regression for rollback " Fiona Ebner
@ 2026-07-06  9:40 ` Fiona Ebner
  2026-07-06  9:40 ` [PATCH storage 3/3] zfspool plugin: clone: fix linked clone of container subvol with refquota=none Fiona Ebner
  2026-07-06 10:22 ` [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone " Filip Schauer
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-07-06  9:40 UTC (permalink / raw)
  To: pve-devel

No functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/Storage/ZFSPoolPlugin.pm | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/PVE/Storage/ZFSPoolPlugin.pm b/src/PVE/Storage/ZFSPoolPlugin.pm
index 0531a5d..c463112 100644
--- a/src/PVE/Storage/ZFSPoolPlugin.pm
+++ b/src/PVE/Storage/ZFSPoolPlugin.pm
@@ -725,10 +725,7 @@ sub clone_image {
     my $name = $class->find_free_diskname($storeid, $scfg, $vmid, $format);
 
     if ($format eq 'subvol') {
-        my $size = $class->zfs_request(
-            $scfg, undef, 'list', '-Hp', '-o', 'refquota', "$scfg->{pool}/$basename",
-        );
-        chomp($size);
+        my $refquota = $class->zfs_get_properties($scfg, 'refquota', "$scfg->{pool}/$basename");
         $class->zfs_request(
             $scfg,
             undef,
@@ -736,7 +733,7 @@ sub clone_image {
             "$scfg->{pool}/$basename\@$snap",
             "$scfg->{pool}/$name",
             '-o',
-            "refquota=$size",
+            "refquota=$refquota",
         );
     } else {
         $class->zfs_request(
-- 
2.47.3





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

* [PATCH storage 3/3] zfspool plugin: clone: fix linked clone of container subvol with refquota=none
  2026-07-06  9:40 [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone with refquota=none Fiona Ebner
  2026-07-06  9:40 ` [PATCH storage 1/3] zfspool plugin: fix regression for rollback " Fiona Ebner
  2026-07-06  9:40 ` [PATCH storage 2/3] zfspool plugin: clone image: use zfs_get_properties() helper Fiona Ebner
@ 2026-07-06  9:40 ` Fiona Ebner
  2026-07-06 10:22 ` [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone " Filip Schauer
  3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-07-06  9:40 UTC (permalink / raw)
  To: pve-devel

ZFS does not accept the value 0 for the refquota property, but
requires 'none' to be used instead. The refquota is queried with '-p'
to get the exact parsable value and there, 'none' is returned as 0. It
needs to be converted back to 'none' for the 'zfs clone' invocation.

Fixes: 851658c ("Change zfs path when link clone are used")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/Storage/ZFSPoolPlugin.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/Storage/ZFSPoolPlugin.pm b/src/PVE/Storage/ZFSPoolPlugin.pm
index c463112..418a65b 100644
--- a/src/PVE/Storage/ZFSPoolPlugin.pm
+++ b/src/PVE/Storage/ZFSPoolPlugin.pm
@@ -726,6 +726,7 @@ sub clone_image {
 
     if ($format eq 'subvol') {
         my $refquota = $class->zfs_get_properties($scfg, 'refquota', "$scfg->{pool}/$basename");
+        $refquota = 'none' if $refquota == 0; # zfs does not accept 0 for refquota property
         $class->zfs_request(
             $scfg,
             undef,
-- 
2.47.3





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

* Re: [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone with refquota=none
  2026-07-06  9:40 [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone with refquota=none Fiona Ebner
                   ` (2 preceding siblings ...)
  2026-07-06  9:40 ` [PATCH storage 3/3] zfspool plugin: clone: fix linked clone of container subvol with refquota=none Fiona Ebner
@ 2026-07-06 10:22 ` Filip Schauer
  3 siblings, 0 replies; 5+ messages in thread
From: Filip Schauer @ 2026-07-06 10:22 UTC (permalink / raw)
  To: Fiona Ebner, pve-devel

On 06/07/2026 11:43, Fiona Ebner wrote:
> As reported in the community forum [0], rollback of a container with a
> ZFS dataset with 'refquota=none' would fail. Similarly, cloning such a
> container would fail as well. The reason is that ZFS does not accept a
> 0 value for the refquota property, but returns 0 when queried with -p.
>
> [0]: https://forum.proxmox.com/threads/184113/
>
> pve-storage:
>
> Fiona Ebner (3):
>    zfspool plugin: fix regression for rollback with refquota=none
>    zfspool plugin: clone image: use zfs_get_properties() helper
>    zfspool plugin: clone: fix linked clone of container subvol with
>      refquota=none
>
>   src/PVE/Storage/ZFSPoolPlugin.pm | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
>
> Summary over all repositories:
>    1 files changed, 4 insertions(+), 5 deletions(-)
>
With this applied, rolling back to a snapshot with
pve-storage:refquota=0 now works and correctly sets refquota=none.

Tested-by: Filip Schauer <f.schauer@proxmox.com>





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

end of thread, other threads:[~2026-07-06 10:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06  9:40 [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone with refquota=none Fiona Ebner
2026-07-06  9:40 ` [PATCH storage 1/3] zfspool plugin: fix regression for rollback " Fiona Ebner
2026-07-06  9:40 ` [PATCH storage 2/3] zfspool plugin: clone image: use zfs_get_properties() helper Fiona Ebner
2026-07-06  9:40 ` [PATCH storage 3/3] zfspool plugin: clone: fix linked clone of container subvol with refquota=none Fiona Ebner
2026-07-06 10:22 ` [PATCH-SERIES storage 0/3] zfspool plugin: fix container rollback and linked clone " Filip Schauer

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