]> git.proxmox.com Git - pve-storage.git/commitdiff
fix #3345: zfs: restore container volume to ZFS with size 0
authorAaron Lauterer <a.lauterer@proxmox.com>
Fri, 9 Apr 2021 15:10:25 +0000 (17:10 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Apr 2021 12:37:50 +0000 (14:37 +0200)
A restore to ZFS for a container which has a volume (rootfs / mount
point) of size 0 failed because the refquota property does not accept
'0k' but wants 'none' in that situation.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage/ZFSPoolPlugin.pm

index fe65ae457784a1e95d5611c601636c029968413b..2e2abe35ac092a2f60ea1959ab97a0d68799551d 100644 (file)
@@ -334,9 +334,10 @@ sub zfs_create_subvol {
     my ($class, $scfg, $volname, $size) = @_;
 
     my $dataset = "$scfg->{pool}/$volname";
+    my $quota = $size ? "${size}k" : "none";
 
     my $cmd = ['create', '-o', 'acltype=posixacl', '-o', 'xattr=sa',
-              '-o', "refquota=${size}k", $dataset];
+              '-o', "refquota=${quota}", $dataset];
 
     $class->zfs_request($scfg, undef, @$cmd);
 }