From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup] tape: mam: actually enforcing the length when writing attributes
Date: Fri, 24 May 2024 10:26:08 +0200 [thread overview]
Message-ID: <8c4a479e-2181-4e56-9c52-abe167ab56bd@proxmox.com> (raw)
In-Reply-To: <8ed01519-808b-4fb2-971e-a587f3719dc2@proxmox.com>
Am 24/05/2024 um 10:19 schrieb Dominik Csapak:
> On 5/24/24 09:50, Thomas Lamprecht wrote:
>> Am 23/05/2024 um 12:08 schrieb Dominik Csapak:
>>> + } else if data.len() > attribute.len as usize {
>>> bail!("data to long");
>>
>> Can we extend this error with the attribute name, the length we got and
>> the defined max length to have some more info for when a user runs into
>> this?
>>
>> Something like:
>>
>> bail!("attribute '{}' length {} is over the maximum allowed length {}", ...);
>>
>> Or is this error already extended/concatenated with similar info somewhere
>> in the return chain (sorry, just doing a quick review directly in my MUA)
>
>
> it's logged with:
>
> could not set MAM attribute {id}: {err}
OK, thanks for checking.
> and from the id we can infer the maximum length
It still is nice for the end user to get to see that, if some (description
or label) attribute would become more free form in the future, even if
we'd say that's unlikely it's IMO just way to cheap to even thinking about
not doing it..
>
> but printing the expected/actual len probably make sense
>
Yeah, please print both, got and expected.
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
prev parent reply other threads:[~2024-05-24 8:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-23 10:08 Dominik Csapak
2024-05-24 7:50 ` Thomas Lamprecht
2024-05-24 8:19 ` Dominik Csapak
2024-05-24 8:26 ` Thomas Lamprecht [this message]
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=8c4a479e-2181-4e56-9c52-abe167ab56bd@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@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