linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: linux-raid@vger.kernel.org, yukuai3@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH v3 3/4] mdadm: remove bitmap file support
Date: Wed, 20 Nov 2024 11:27:30 +0100	[thread overview]
Message-ID: <20241120112730.00002cbe@linux.intel.com> (raw)
In-Reply-To: <20241120064637.3657385-4-yukuai1@huaweicloud.com>

On Wed, 20 Nov 2024 14:46:36 +0800
Yu Kuai <yukuai1@huaweicloud.com> wrote:

> From: Yu Kuai <yukuai3@huawei.com>
> 
> Because it's marked deprecated for a long time now, and it's not worthy
> to support it for new bitmap.
> 
> Now that we don't need to store filename for bitmap, also declare a new
> enum type bitmap_type to simplify code.

Thanks for the enum! I really appreciate the additional effort you took to
make mdadm better.

I didn't not review it line by line because I see the problem that must
be resolved first.

I see that you added BitmapNone and BitmapUnknown and their usage is not clear,
let me help you!

BitmapUnknown should be used only if we failed to parse bitmap setting in
cmdline. Otherwise first and default value should be always BitmapNone
because data access is always highest priority and dropping bitmap is always
safe. We can print warning in config parse failed or bitmap value is repeated-
it is reasonable. If I'm wrong here, please let me know.

+ It would be nice to add tests to cover these config/cmdline bitmap
  possibilities to define clear set of expected behavior. It is something
  already missed so I do not require that strongly from you know.

I propose you to create mapping_t for bitmap and to use map_name() to match the
bitmap strings, instead of hardcoding them but it is my recommendation not
something strongly required.

Then, you would be able to remove some checks for both (s->btype != BitmapNone
&& s->btype != BitmapUnknown).

The change proposed by my will provide clear differentiation between error
value and set of accepted values, messing that is always confusing for
maintainers end readers. I don't see that kind of mess necessary in this case.

Thanks,
Mariusz

  reply	other threads:[~2024-11-20 10:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-20  6:46 [PATCH v3 0/4] mdadm: remove bitmap file support Yu Kuai
2024-11-20  6:46 ` [PATCH v3 1/4] tests/04update-uuid: remove bitmap file test Yu Kuai
2024-11-20  6:46 ` [PATCH v3 2/4] tests/05r1-re-add-nosuper: " Yu Kuai
2024-11-20  6:46 ` [PATCH v3 3/4] mdadm: remove bitmap file support Yu Kuai
2024-11-20 10:27   ` Mariusz Tkaczyk [this message]
2024-11-21  1:25     ` Yu Kuai
2024-11-21  8:15       ` Mariusz Tkaczyk
2024-11-22  1:13         ` Yu Kuai
2024-11-22  7:55           ` Mariusz Tkaczyk
2024-11-22  8:04             ` Yu Kuai
2024-11-20  6:46 ` [PATCH v3 4/4] Manage: forbid re-add to the array without metadata Yu Kuai
2024-11-20 10:36   ` 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=20241120112730.00002cbe@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.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).