Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mtkaczyk@kernel.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: linux-raid@vger.kernel.org, yukuai3@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH RFC mdadm/master] mdadm: add support for new lockless bitmap
Date: Mon, 27 Jan 2025 10:25:47 +0100	[thread overview]
Message-ID: <20250127102547.60a62a4c@mtkaczyk-private-dev> (raw)
In-Reply-To: <20250126082714.1588025-1-yukuai1@huaweicloud.com>

On Sun, 26 Jan 2025 16:27:14 +0800
Yu Kuai <yukuai1@huaweicloud.com> wrote:

> From: Yu Kuai <yukuai3@huawei.com>
> 
> A new major number 6 is used for the new bitmap.
> 
> Noted that for the kernel that doesn't support lockless bitmap, create
> such array will fail:
> 
> md0: invalid bitmap file superblock: unrecognized superblock version.
Hi Kuai,

Please go ahead and create branch on mdadm repo for lockness bitmap
implementation and keep your changes there. This is for sure not ready
and cannot be merged yet to main so sending it is not needed.

What do you think?
> 
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  Create.c | 5 ++++-
>  Grow.c   | 3 ++-
>  bitmap.h | 1 +
>  mdadm.c  | 9 ++++++++-
>  mdadm.h  | 1 +
>  super1.c | 9 +++++++++
>  6 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/Create.c b/Create.c
> index fd6c9215..105d15e0 100644
> --- a/Create.c
> +++ b/Create.c
> @@ -541,6 +541,8 @@ int Create(struct supertype *st, struct
> mddev_ident *ident, int subdevs, pr_err("At least 2 nodes are needed
> for cluster-md\n"); return 1;
>  		}
> +	} else if (s->btype == BitmapLockless) {
> +		major_num = BITMAP_MAJOR_LOCKLESS;
>  	}
>  
>  	memset(&info, 0, sizeof(info));
> @@ -1182,7 +1184,8 @@ int Create(struct supertype *st, struct
> mddev_ident *ident, int subdevs,
>  	 * to stop another mdadm from finding and using those
> devices. */
>  
> -	if (s->btype == BitmapInternal || s->btype == BitmapCluster)
> {
> +	if (s->btype == BitmapInternal || s->btype == BitmapCluster
> ||
> +	    s->btype == BitmapLockless) {

This is asking to be moved to common helper function. Is is repeated 3
times at least so please consider (not sure about naming):

bool is_bitmap_supported(int btype) {
	if (btype == BitmapInternal || btype == BitmapCluster ||
	    btype == BitmapLockless)
		return true;
	return false;
}
Just a nit.

  reply	other threads:[~2025-01-27  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-26  8:27 [PATCH RFC mdadm/master] mdadm: add support for new lockless bitmap Yu Kuai
2025-01-27  9:25 ` Mariusz Tkaczyk [this message]
2025-02-06  1:35   ` Yu Kuai

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=20250127102547.60a62a4c@mtkaczyk-private-dev \
    --to=mtkaczyk@kernel.org \
    --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