Re: [PATCH] Export MDRAID bitmap on disk structure in UAPI header file
From: Mariusz Tkaczyk
Date: Mon Feb 03 2025 - 06:44:05 EST
On Tue, 31 Dec 2024 04:09:27 +0100
Tomas Mudrunka <tomas.mudrunka@xxxxxxxxx> wrote:
> When working on software that manages MD RAID disks from
> userspace. Currently provided headers only contain MD superblock.
> That is not enough to fully populate MD RAID metadata.
> Therefore this patch adds bitmap superblock as well.
>
> Signed-off-by: Tomas Mudrunka <tomas.mudrunka@xxxxxxxxx>
> ---
Hello Tomas,
Jumping here again.. I tried to build mdadm against your patch.
In mdadm we used copied headers for years. I submitted PR for review:
This simple one to remove legacy ifdef:
https://github.com/md-raid-utilities/mdadm/pull/148
And this one to start using kernel provided headers:
https://github.com/md-raid-utilities/mdadm/pull/149
Going back to you change, to integrate it with mdadm well I need:
/* Notify that kernel provides it */
#define MD_BITMAP_SUBERBLOCK_EXPORTED 1
Probably I can use any define to check it, but for clarity I would like
to keep clear differentiation. I hope it is not a problem.
And missing defines used by mdadm:
#define BITMAP_MAJOR_LO 3
/* version 4 insists the bitmap is in little-endian order
* with version 3, it is host-endian which is non-portable
*/
#define BITMAP_MAJOR_HI 4
#define BITMAP_MAJOR_CLUSTERED 5
see:
https://github.com/md-raid-utilities/mdadm/blob/main/bitmap.h
After that, I should be able to compile mdadm.
Thanks,
Mariusz