all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH installer] fix space calculation for small disks for pve product
@ 2023-06-22 13:57 Stoiko Ivanov
  2023-06-22 14:29 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2023-06-22 13:57 UTC (permalink / raw)
  To: pve-devel

The convoluted calculation logic in case the disks is 8GB leads to
datasize becoming 16EiB further down:
* after calculating and removing the rootsize from $rest, $rest becomes
  smaller than $space (which should be the minimal non-used space in the
  volume-group) - this leads to a negative value, which overflows in
  the `& ~0xFFF` opration.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
tested in a VM with an 8GB disk

 Proxmox/Install.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
index 7970f83..28add10 100644
--- a/Proxmox/Install.pm
+++ b/Proxmox/Install.pm
@@ -425,7 +425,7 @@ sub create_lvm_volumes {
 	my $rootsize_mb;
 	if ($rest_mb < 12 * 1024) {
 	    # no point in wasting space, try to get us actually installed and align down to 4 MB
-	    $rootsize_mb = ($rest_mb - 0.1) & ~3;
+	    $rootsize_mb = ($rest_mb - 4) & ~3;
 	} elsif ($rest_mb < 48 * 1024) {
 	    my $masked = int($rest_mb / 2) & ~3; # align down to 4 MB
 	    $rootsize_mb = $masked;
-- 
2.30.2





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

* [pve-devel] applied: [PATCH installer] fix space calculation for small disks for pve product
  2023-06-22 13:57 [pve-devel] [PATCH installer] fix space calculation for small disks for pve product Stoiko Ivanov
@ 2023-06-22 14:29 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-06-22 14:29 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stoiko Ivanov

Am 22/06/2023 um 15:57 schrieb Stoiko Ivanov:
> The convoluted calculation logic in case the disks is 8GB leads to
> datasize becoming 16EiB further down:
> * after calculating and removing the rootsize from $rest, $rest becomes
>   smaller than $space (which should be the minimal non-used space in the
>   volume-group) - this leads to a negative value, which overflows in
>   the `& ~0xFFF` opration.
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> tested in a VM with an 8GB disk
> 
>  Proxmox/Install.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, thanks!




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

end of thread, other threads:[~2023-06-22 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-22 13:57 [pve-devel] [PATCH installer] fix space calculation for small disks for pve product Stoiko Ivanov
2023-06-22 14:29 ` [pve-devel] applied: " Thomas Lamprecht

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