public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Shan Shaji" <s.shaji@proxmox.com>
To: "Nicolas Frey" <n.frey@proxmox.com>, <pbs-devel@lists.proxmox.com>
Subject: Re: [PATCH proxmox 3/3] pbs-api-types: zfs: define schema for recordsize
Date: Tue, 11 Aug 2026 15:41:52 +0200	[thread overview]
Message-ID: <DKM5P4ECG09J.39YRBOJP2OGJF@proxmox.com> (raw)
In-Reply-To: <8f67a923-1469-4742-91c0-a1355e366e5b@proxmox.com>

Hi,

Thanks for testing the changes. 

On Tue Aug 11, 2026 at 1:12 PM CEST, Nicolas Frey wrote:
> when using the CLI, this currently creates a zpool even though the
> validation *should* fail. e.g. the following command:
>
> proxmox-backup-manager disk zpool create test1 \
> 	--devices sdc --raidlevel single --recordsize=12
>
> prints this error:
>
> command "zfs" "set" "recordsize=12" "relatime=on" "test1" failed -
> status code: 255 - cannot set property for 'test1': 'recordsize' must
> be power of 2 from 512B to 16M
>
> but still creates a zfs pool with the default 128K record size.

Somehow missed this one, thank you for finding it. will send a v2

> On 8/4/26 2:40 PM, Shan Shaji wrote:
>> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
>> ---
>>  pbs-api-types/src/zfs.rs | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/pbs-api-types/src/zfs.rs b/pbs-api-types/src/zfs.rs
>> index 2cfbd403..3cfb9f8f 100644
>> --- a/pbs-api-types/src/zfs.rs
>> +++ b/pbs-api-types/src/zfs.rs
>> @@ -6,6 +6,7 @@ use proxmox_schema::*;
>>  
>>  const_regex! {
>>      pub ZPOOL_NAME_REGEX = r"^[a-zA-Z][a-z0-9A-Z\-_.:]+$";
>> +    ZFS_RECORD_SIZE_REGEX = r"^(?i)([1-9][0-9]*)([km])?$";
>>  }
>>  
>>  pub const ZFS_ASHIFT_SCHEMA: Schema = IntegerSchema::new("Pool sector size exponent.")
>> @@ -18,6 +19,10 @@ pub const ZPOOL_NAME_SCHEMA: Schema = StringSchema::new("ZFS Pool Name")
>>      .format(&ApiStringFormat::Pattern(&ZPOOL_NAME_REGEX))
>>      .schema();
>>  
>> +pub const ZFS_RECORD_SIZE_SCHEMA: Schema = StringSchema::new("ZFS Recordsize. Use numbers with optional k or m suffix (e.g., 128k).")
>> +    .format(&ApiStringFormat::Pattern(&ZFS_RECORD_SIZE_REGEX))
>
> consider using `ApiStringFormat::VerifyFn` to verify the record size,
> analagous to the one you have in javascript

Ack

>> +    .schema();
>> +
>>  #[api(default: "On")]
>>  #[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
>>  #[serde(rename_all = "lowercase")]





  reply	other threads:[~2026-08-11 13:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04 12:40 [PATCH proxmox{-backup,} 0/3] partially fix #6933: add option to specify zfs recordsize Shan Shaji
2026-08-04 12:40 ` [PATCH proxmox-backup 1/3] partially fix #6933: ui: storage: " Shan Shaji
2026-08-04 12:40 ` [PATCH proxmox-backup 2/3] partially fix #6933: bin: add option to specify ZFS recordsize Shan Shaji
2026-08-04 12:40 ` [PATCH proxmox 3/3] pbs-api-types: zfs: define schema for recordsize Shan Shaji
2026-08-11 11:12   ` Nicolas Frey
2026-08-11 13:41     ` Shan Shaji [this message]
2026-08-12 11:07       ` superseded: " Shan Shaji

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=DKM5P4ECG09J.39YRBOJP2OGJF@proxmox.com \
    --to=s.shaji@proxmox.com \
    --cc=n.frey@proxmox.com \
    --cc=pbs-devel@lists.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 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