[pve-devel] [PATCH storage 3/3] btrfs: fix qgroup id and size in volume resize

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Jun 24 12:01:42 CEST 2021


also fixes volume_size_info in scalar context for subvols

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 PVE/Storage/BTRFSPlugin.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/Storage/BTRFSPlugin.pm b/PVE/Storage/BTRFSPlugin.pm
index ccdf3c8..f5e5e25 100644
--- a/PVE/Storage/BTRFSPlugin.pm
+++ b/PVE/Storage/BTRFSPlugin.pm
@@ -494,7 +494,7 @@ sub volume_size_info {
 	if ($scfg->{quotas}) {
 	    ($used, $size) = btrfs_subvol_quota($class, $path);
 	}
-	return wantarray ? ($size, 'subvol', $used, undef, $ctime) : 1;
+	return wantarray ? ($size, 'subvol', $used, undef, $ctime) : $size;
     }
 
     return PVE::Storage::Plugin::file_size_info($path, $timeout);
@@ -509,8 +509,8 @@ sub volume_resize {
 	    if !$scfg->{quotas};
 
 	my $path = $class->filesystem_path($scfg, $volname);
-	my $id = '0/' . $class->btrfs_get_subvol_id($path);
-	$class->btrfs_cmd(['qgroup', 'limit', '--', "${size}k", "0/$id", $path]);
+	my $qid = '0/' . $class->btrfs_get_subvol_id($path);
+	$class->btrfs_cmd(['qgroup', 'limit', '--', $size, $qid, $path]);
 	return undef;
     }
 
-- 
2.30.2






More information about the pve-devel mailing list