public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage] btrfs: fix qgroup id and size in volume resize
@ 2021-06-24  8:41 Wolfgang Bumiller
  2021-06-24  9:24 ` Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Bumiller @ 2021-06-24  8:41 UTC (permalink / raw)
  To: pve-devel

also fixes volume_size_info in scalar context for subvols

Signed-off-by: Wolfgang Bumiller <w.bumiller@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 6ae93c2..0d8bf4b 100644
--- a/PVE/Storage/BTRFSPlugin.pm
+++ b/PVE/Storage/BTRFSPlugin.pm
@@ -489,7 +489,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);
@@ -504,8 +504,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





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

* Re: [pve-devel] [PATCH storage] btrfs: fix qgroup id and size in volume resize
  2021-06-24  8:41 [pve-devel] [PATCH storage] btrfs: fix qgroup id and size in volume resize Wolfgang Bumiller
@ 2021-06-24  9:24 ` Thomas Lamprecht
  2021-06-24  9:57   ` Wolfgang Bumiller
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Lamprecht @ 2021-06-24  9:24 UTC (permalink / raw)
  To: Proxmox VE development discussion, Wolfgang Bumiller

On 24.06.21 10:41, Wolfgang Bumiller wrote:
> also fixes volume_size_info in scalar context for subvols
> 
> Signed-off-by: Wolfgang Bumiller <w.bumiller@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 6ae93c2..0d8bf4b 100644
> --- a/PVE/Storage/BTRFSPlugin.pm
> +++ b/PVE/Storage/BTRFSPlugin.pm
> @@ -489,7 +489,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);
> @@ -504,8 +504,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;
>      }
>  
> 

does not applies, and it seems that it neither did before the "check for btrfs" + my
followup patches..




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

* Re: [pve-devel] [PATCH storage] btrfs: fix qgroup id and size in volume resize
  2021-06-24  9:24 ` Thomas Lamprecht
@ 2021-06-24  9:57   ` Wolfgang Bumiller
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bumiller @ 2021-06-24  9:57 UTC (permalink / raw)
  To: Thomas Lamprecht; +Cc: Proxmox VE development discussion

On Thu, Jun 24, 2021 at 11:24:15AM +0200, Thomas Lamprecht wrote:
> On 24.06.21 10:41, Wolfgang Bumiller wrote:
> > also fixes volume_size_info in scalar context for subvols
> > 
> > Signed-off-by: Wolfgang Bumiller <w.bumiller@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 6ae93c2..0d8bf4b 100644
> > --- a/PVE/Storage/BTRFSPlugin.pm
> > +++ b/PVE/Storage/BTRFSPlugin.pm
> > @@ -489,7 +489,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);
> > @@ -504,8 +504,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;
> >      }
> >  
> > 
> 
> does not applies, and it seems that it neither did before the "check for btrfs" + my
> followup patches..

My bad, this was on top of the fixed quotas support.




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

end of thread, other threads:[~2021-06-24  9:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24  8:41 [pve-devel] [PATCH storage] btrfs: fix qgroup id and size in volume resize Wolfgang Bumiller
2021-06-24  9:24 ` Thomas Lamprecht
2021-06-24  9:57   ` Wolfgang Bumiller

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