linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <jes@trained-monkey.org>
To: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Cc: colyli@suse.de, linux-raid@vger.kernel.org
Subject: Re: [PATCH 2/3] mdadm: refactor ident->name handling
Date: Fri, 10 Mar 2023 09:43:11 -0500	[thread overview]
Message-ID: <3f1f7b12-397a-d363-d075-e074c0913e64@trained-monkey.org> (raw)
In-Reply-To: <20230309090207.00002769@linux.intel.com>

On 3/9/23 03:02, Mariusz Tkaczyk wrote:
> On Wed, 8 Mar 2023 14:04:12 -0500
>> Maybe it would be worth starting the enum outside the range of the
>> regular errno so they can overlap? Not sure if it adds any value, just a
>> thought.
>>
> I see no value either.
> What if someone will add new error definition to errno? Should we change our
> enum start then? I think that nobody will notice it until issue but it is
> unlikely too. For that reason I think that it is pointless from the beggining
> because we are defnining rule which won't be honored later.
> 
> I think that we can just to redefine errno codes in enum if they are needed. We
> are free to change particular enum constant value to make room for errno
> compatible codes if there will be need to. That should be safe if some code
> does not have ugly trick like calling external function and comparing it with
> enum constant:
> 
> */ let's say that SUCCESS is 0 */
> if (strncmp(arg, arg1, arg2) == ENUM_STATUS_SUCCESS)
> 
> but it is our job to catch it on review so we are safe here, right? :)

Fair enough

Jes


  reply	other threads:[~2023-03-10 14:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21 11:50 [PATCH 0/3] Validation for names during creation Mariusz Tkaczyk
2022-12-21 11:50 ` [PATCH 1/3] mdadm: create ident_init() Mariusz Tkaczyk
2022-12-28 15:05   ` Jes Sorensen
2022-12-21 11:50 ` [PATCH 2/3] mdadm: refactor ident->name handling Mariusz Tkaczyk
2022-12-28 15:07   ` Jes Sorensen
2022-12-29  9:39     ` Mariusz Tkaczyk
2023-01-09 10:51       ` Mariusz Tkaczyk
2023-03-02 14:52       ` Jes Sorensen
2023-03-03 12:04         ` Mariusz Tkaczyk
2023-03-08 19:04           ` Jes Sorensen
2023-03-09  8:02             ` Mariusz Tkaczyk
2023-03-10 14:43               ` Jes Sorensen [this message]
2022-12-21 11:50 ` [PATCH 3/3] Limit length and set of characters allowed of devname Mariusz Tkaczyk
2023-03-13 14:22   ` Jes Sorensen
2023-03-14  8:14     ` Mariusz Tkaczyk

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=3f1f7b12-397a-d363-d075-e074c0913e64@trained-monkey.org \
    --to=jes@trained-monkey.org \
    --cc=colyli@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.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;
as well as URLs for NNTP newsgroup(s).