From 8c858f7eebd6e130d06222286645a8f7c495f17c Mon Sep 17 00:00:00 2001 From: Aaron Lauterer Date: Fri, 9 Apr 2021 17:10:25 +0200 Subject: [PATCH] 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 Signed-off-by: Thomas Lamprecht --- PVE/Storage/ZFSPoolPlugin.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index fe65ae4..2e2abe3 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -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); }