From: Fiona Ebner <f.ebner@proxmox.com>
To: Wolfgang Bumiller <w.bumiller@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH storage 2/6] btrfs: fix volume size info for subvolumes in scalar context
Date: Mon, 3 Mar 2025 10:03:06 +0100 [thread overview]
Message-ID: <930f1575-c68b-4a59-af11-477ec93b845e@proxmox.com> (raw)
In-Reply-To: <c76lrjm3fln5vasd47clrghnzgeqf6xkcj6rdk25g5tvz4wyjb@lxiojhkbujqf>
Am 03.03.25 um 08:31 schrieb Wolfgang Bumiller:
> On Fri, Feb 28, 2025 at 03:50:18PM +0100, Fiona Ebner wrote:
>> Return the same size as in list context. See also commit "plugin: file
>> size info: be consistent about size of directory subvol".
>>
>> Fixes cloning containers with unsized subvolumes on BTRFS. Before the
>> change, this would fail with "mkfs.ext4: Device size reported to be
>> zero.".
>
> Interesting how it says "reported to be zero", when this commit changes
> it from `1` to, well, zero?
When allocating the volume for the clone, we use the same size as the
old volume. The value 0 will lead to using 'subvol' format for the new
volume. With 1, it tries to use 'raw' format and then fails when
attempting to format.
>
>>
>> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
>> ---
>> src/PVE/Storage/BTRFSPlugin.pm | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm
>> index 1966b6f..b1f7912 100644
>> --- a/src/PVE/Storage/BTRFSPlugin.pm
>> +++ b/src/PVE/Storage/BTRFSPlugin.pm
>> @@ -486,7 +486,7 @@ sub volume_size_info {
>> my $ctime = (stat($path))[10];
>> my ($used, $size) = (0, 0);
>> #my ($used, $size) = btrfs_subvol_quota($class, $path); # uses wantarray
>> - 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, $format);
>> --
>> 2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-03-03 9:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 14:50 [pve-devel] [PATCH-SERIES storage 0/6] unsized subvol regression fix and improvements Fiona Ebner
2025-02-28 14:50 ` [pve-devel] [PATCH storage 1/6] plugin: file size info: be consistent about size of directory subvol Fiona Ebner
2025-02-28 14:50 ` [pve-devel] [PATCH storage 2/6] btrfs: fix volume size info for subvolumes in scalar context Fiona Ebner
2025-03-03 7:31 ` Wolfgang Bumiller
2025-03-03 9:03 ` Fiona Ebner [this message]
2025-03-03 9:10 ` Fiona Ebner
2025-02-28 14:50 ` [pve-devel] [PATCH storage 3/6] plugin: volume export formats: avoid superfluous file_size_info() call Fiona Ebner
2025-02-28 14:50 ` [pve-devel] [PATCH storage 4/6] api: volume info: do not fail for zero-sized subvolumes Fiona Ebner
2025-02-28 14:50 ` [pve-devel] [PATCH storage 5/6] btrfs: die early for broken subvolume resize Fiona Ebner
2025-03-03 8:02 ` Wolfgang Bumiller
2025-02-28 14:50 ` [pve-devel] [PATCH storage 6/6] btrfs: note that btrfs_get_subvol_id() function is broken Fiona Ebner
2025-03-03 8:04 ` Wolfgang Bumiller
2025-03-03 9:25 ` [pve-devel] [PATCH-SERIES storage 0/6] unsized subvol regression fix and improvements Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=930f1575-c68b-4a59-af11-477ec93b845e@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=w.bumiller@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal