From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9])
	by lore.proxmox.com (Postfix) with ESMTPS id 16C631FF173
	for <inbox@lore.proxmox.com>; Mon, 13 Jan 2025 13:24:38 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 3E5562E061;
	Mon, 13 Jan 2025 13:24:19 +0100 (CET)
Date: Mon, 13 Jan 2025 13:24:06 +0100
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Daniel Kral <d.kral@proxmox.com>
References: <20250110170040.201474-1-d.kral@proxmox.com>
 <20250110170040.201474-2-d.kral@proxmox.com>
In-Reply-To: <20250110170040.201474-2-d.kral@proxmox.com>
MIME-Version: 1.0
Message-ID: <mailman.254.1736771058.441.pve-devel@lists.proxmox.com>
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Post: <mailto:pve-devel@lists.proxmox.com>
From: Fabio Fantoni via pve-devel <pve-devel@lists.proxmox.com>
Precedence: list
Cc: Fabio Fantoni <fabio.fantoni@m2r.biz>
X-Mailman-Version: 2.1.29
X-BeenThere: pve-devel@lists.proxmox.com
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
Subject: Re: [pve-devel] [RFC PATCH 2/2] common: btrfs: lower minimum amount
 of disks for raid10 to 2
Content-Type: multipart/mixed; boundary="===============8718224634189867295=="
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

--===============8718224634189867295==
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <fabio.fantoni@m2r.biz>
X-Original-To: pve-devel@lists.proxmox.com
Delivered-To: pve-devel@lists.proxmox.com
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by lists.proxmox.com (Postfix) with ESMTPS id 04C0CCC496
	for <pve-devel@lists.proxmox.com>; Mon, 13 Jan 2025 13:24:17 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id D04362E0A4
	for <pve-devel@lists.proxmox.com>; Mon, 13 Jan 2025 13:24:16 +0100 (CET)
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by firstgate.proxmox.com (Proxmox) with ESMTPS
	for <pve-devel@lists.proxmox.com>; Mon, 13 Jan 2025 13:24:16 +0100 (CET)
Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5d41848901bso872784a12.0
        for <pve-devel@lists.proxmox.com>; Mon, 13 Jan 2025 04:24:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=m2r-biz.20230601.gappssmtp.com; s=20230601; t=1736771049; x=1737375849; darn=lists.proxmox.com;
        h=content-transfer-encoding:in-reply-to:from:references:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=g9dDF9WsYgl+37wru8VVBHJD0dQUP6hyqNK7aiwkA6g=;
        b=1YhfJlWixsQKhV8vzhN+3eju+89E6MJTBF3Tz48eSVEnIk6T9w5fKUBQ4Me6Yw/HfO
         qkBO4eozdWktKmHYFbiIuytYM6Zf8PWLozMxySHcHfhkEYSqpFzeV5Xzh/FIMPw8JmDf
         wPNk3jC8bR2SxRsW/eJrRwkHD02Pp+ghDBBp2quB2jP/3U6/zz3B55HsvXeRUWgAizm4
         FhyNFQL5lmT4a2+3ndzA3drP6CUirnR9cqmYgjvqGHY9413Q8e0INgQFjQ3v/yXXArRg
         abaKlO2pY5ey19EAOICtGNM7cVd1RGR6DNHnnkoQlz3Xt6rlC3jdLTRbPYzFsKi75R0o
         Zkgg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1736771049; x=1737375849;
        h=content-transfer-encoding:in-reply-to:from:references:to
         :content-language:subject:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=g9dDF9WsYgl+37wru8VVBHJD0dQUP6hyqNK7aiwkA6g=;
        b=VAIjiE8kcrihAy3ntHsnRF1XlUtj5P0jHYF6EwtphWlNLVXw46rI890Ebe0AfzuGt+
         2YRuAtxcgNjQ5nhrJNXAq128aQfgojB8qKamQko0Nrl/WrD6/c5/uHkHjIZX1fr/CqlW
         4lFDvW4LipGlz3PQFkKP8xDE6S/hV2GpvSTSzrQ4QfqWPWX9G6YhtIhHgM0ov2bvQx7m
         LtMplvAJgLKqBrstT1hlJAxeg91Ho91Qy8V+zQ9ekuTLG1g6sy0bTptcTeTblXuQt4kl
         x6gNQtZ+Pl1gFikX1ImOgfO4vilTJQx+DG4sX/uTNqo8mQ2aqH1h9wtAfLKFTm0NAmXt
         +yPA==
X-Gm-Message-State: AOJu0YwW32P87Hy5QVBa8NqGBQ5JsQH18jYjIAMl+tHuuoZw/QB32Ddb
	YFZuUcDHQfQZ+uYPiOvZTbUdKPM3AnWT+MgUr4p5TVnj9/mrUbgTRuoPRJ9ZtP9w/3hKbNuFKNs
	Y
X-Gm-Gg: ASbGncux5o1Ex5ONIhjs647yDlKwtkywurwbJfGUshNmoELG25Sml6gC128if79BdIp
	LKn24v0YSRChfTsHMizB4DzT7AGR3qXlDDmfZ26Vwz30hlNK+vPklFtZwt21oCcZadCdvK//9SB
	c9Iiif6Z+DOJplORHgk6a4tCaG7TG3N6Y28smiAjcBmRZqTbCtRoRZ5ovFGXOepGFKuCrnvglqZ
	m2KyrPkEYE0PsXKGu6GpZOQROesXwx4qTHxV5ghb+gKa9Gpc5kxO3+HPJa4OuqhfHWTuMZ3d25b
	9niGGDePKUoLhaz5wINyVJkpgGdZkc2B1t4nh36n4ZBAVlA=
X-Google-Smtp-Source: AGHT+IHQolfxnfCC7+p5Eke96x6Mz1POQRlBEXw3q512XYx7z1sm87lBbOK5XNRZ6D6NQFcFIhoieA==
X-Received: by 2002:a05:6402:27d2:b0:5d0:b61a:89c9 with SMTP id 4fb4d7f45d1cf-5d98a24a3d1mr14682924a12.5.1736771049566;
        Mon, 13 Jan 2025 04:24:09 -0800 (PST)
Received: from [192.168.178.27] (host-79-16-223-149.retail.telecomitalia.it. [79.16.223.149])
        by smtp.googlemail.com with ESMTPSA id 4fb4d7f45d1cf-5d99046a17fsm4814507a12.62.2025.01.13.04.24.07
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 13 Jan 2025 04:24:08 -0800 (PST)
Message-ID: <0999b2e1-8b8b-4baf-84d6-32251a675338@m2r.biz>
Date: Mon, 13 Jan 2025 13:24:06 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [pve-devel] [RFC PATCH 2/2] common: btrfs: lower minimum amount
 of disks for raid10 to 2
Content-Language: it
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
 Daniel Kral <d.kral@proxmox.com>
References: <20250110170040.201474-1-d.kral@proxmox.com>
 <20250110170040.201474-2-d.kral@proxmox.com>
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
In-Reply-To: <20250110170040.201474-2-d.kral@proxmox.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Antivirus: Avast (VPS 250113-2, 13/1/2025), Outbound message
X-Antivirus-Status: Clean
X-SPAM-LEVEL: Spam detection results:  0
	AWL                    -0.250 Adjusted score from AWL reputation of From: address
	BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
	DKIM_SIGNED               0.1 Message has a DKIM or DK signature, not necessarily valid
	DKIM_VALID               -0.1 Message has at least one valid DKIM or DK signature
	DMARC_PASS               -0.1 DMARC pass policy
	JMQ_SPF_NEUTRAL           0.5 SPF set to ?all
	KAM_INFOUSMEBIZ          0.75 Prevalent use of .info|.us|.me|.me.uk|.biz|xyz|id|rocks|life domains in spam/malware
	KAM_NUMSUBJECT            0.5 Subject ends in numbers excluding current years
	RCVD_IN_DNSWL_NONE     -0.0001 Sender listed at https://www.dnswl.org/, no trust
	SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
	SPF_PASS               -0.001 SPF: sender matches SPF record

Il 10/01/2025 18:00, Daniel Kral ha scritto:
> As the installer allows single-disk RAID0 configurations and BTRFS
> allows to create a filesystem with the RAID10 profile with only two
> disks since kernel version 5.15 [0], lower the minimum amount of disks
> the installer requires for a BTRFS RAID10 setup.
>
> The motiviation for this is to allow users to create a BTRFS RAID10
> configuration even though they do not have the necessary disks ready at
> setup time itself without needing to convert the profile afterwards.

btrfs profiles work differently but other hardware or software raids, 
many users may not inform themselves well beforehand but even in the 
case of informed users even if technically now btrfs allows lower limits 
with the creation of raid 0 (and raid10) I think it would be better to 
keep them at the base at the creation and then it must be the user who 
consciously makes any subsequent conversions.

regarding btrfs profiles at creation, one thing that could be useful is 
to always put duplicate metadata (dup with single disk or raid 1 in the 
case of raid0), if you don't want it by default maybe put it as an 
additional option, and if you don't want that either at least add it to 
the documentation (as a suggestion if you want greater resilience of the 
filesystem without consuming excessive space)

>
> [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/co=
mmit/?id=3Db2f78e88052bc0bee56bbf646d245fcfb431a873
>
> Signed-off-by: Daniel Kral <d.kral@proxmox.com>
> ---
> Discussion
>
> If this patch seems like something worthwile, I think it would be
> necessary to have some sort of warning popup for 2 <=3D $diskcount < 4 in=

> RAID10, and maybe also the same for $diskcount =3D=3D 1 in RAID0, that
> there's no advantage to create a degenerate RAID0/10 without planning to
> add at least 1/2 disks later. I would add this in a v2 or followup if
> this gets ACKed.
>
>   Proxmox/Install.pm                          | 2 +-
>   proxmox-installer-common/src/disk_checks.rs | 6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
> index b72a83e..d52d17b 100644
> --- a/Proxmox/Install.pm
> +++ b/Proxmox/Install.pm
> @@ -365,7 +365,7 @@ sub get_btrfs_raid_setup {
>   	die "btrfs (RAID1) needs at least 2 devices\n" if $diskcount < 2;
>   	$mode =3D 'raid1';
>       } elsif ($filesys eq 'btrfs (RAID10)') {
> -	die "btrfs (RAID10) needs at least 4 devices\n" if $diskcount < 4;
> +	die "btrfs (RAID10) needs at least 2 devices\n" if $diskcount < 2;
>   	$mode =3D 'raid10';
>       } else {
>   	die "unknown btrfs mode '$filesys'\n";
> diff --git a/proxmox-installer-common/src/disk_checks.rs b/proxmox-instal=
ler-common/src/disk_checks.rs
> index ecc43bd..bd1c54c 100644
> --- a/proxmox-installer-common/src/disk_checks.rs
> +++ b/proxmox-installer-common/src/disk_checks.rs
> @@ -129,7 +129,7 @@ pub fn check_btrfs_raid_config(level: BtrfsRaidLevel,=
 disks: &[Disk]) -> Result<
>       match level {
>           BtrfsRaidLevel::Raid0 =3D> check_raid_min_disks(disks, 1)?,
>           BtrfsRaidLevel::Raid1 =3D> check_raid_min_disks(disks, 2)?,
> -        BtrfsRaidLevel::Raid10 =3D> check_raid_min_disks(disks, 4)?,
> +        BtrfsRaidLevel::Raid10 =3D> check_raid_min_disks(disks, 2)?,
>       }
>   
>       Ok(())
> @@ -204,8 +204,8 @@ mod tests {
>           assert!(check_btrfs_raid_config(BtrfsRaidLevel::Raid1, &disks).=
is_ok());
>   
>           assert!(check_btrfs_raid_config(BtrfsRaidLevel::Raid10, &[]).is=
_err());
> -        assert!(check_btrfs_raid_config(BtrfsRaidLevel::Raid10, &disks[.=
=2E3]).is_err());
> -        assert!(check_btrfs_raid_config(BtrfsRaidLevel::Raid10, &disks[.=
=2E4]).is_ok());
> +        assert!(check_btrfs_raid_config(BtrfsRaidLevel::Raid10, &disks[.=
=2E1]).is_err());
> +        assert!(check_btrfs_raid_config(BtrfsRaidLevel::Raid10, &disks[.=
=2E2]).is_ok());
>           assert!(check_btrfs_raid_config(BtrfsRaidLevel::Raid10, &disks)=
=2Eis_ok());
>       }
>   



-- 
Questa email =C3=A8 stata esaminata alla ricerca di virus dal software anti=
virus Avast.
www.avast.com


--===============8718224634189867295==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

--===============8718224634189867295==--