fix #3345: zfs: restore container volume to ZFS with size 0

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>
This commit is contained in:
Aaron Lauterer
2021-04-09 17:10:25 +02:00
committed by Thomas Lamprecht
parent c27fe64810
commit 8c858f7eeb

View 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);
}