lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALTww2_pEnnWTGMbHUvX2CURrEvUHO=t2Notw9-Ynjemr5sDsw@mail.gmail.com>
Date: Wed, 28 May 2025 12:53:05 +0800
From: Xiao Ni <xni@...hat.com>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: hch@....de, colyli@...nel.org, song@...nel.org, yukuai3@...wei.com, 
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, 
	linux-raid@...r.kernel.org, yi.zhang@...wei.com, yangerkun@...wei.com, 
	johnny.chenyi@...wei.com
Subject: Re: [PATCH 12/23] md/md-bitmap: add macros for lockless bitmap

On Sat, May 24, 2025 at 2:18 PM Yu Kuai <yukuai1@...weicloud.com> wrote:
>
> From: Yu Kuai <yukuai3@...wei.com>
>
> Also move other values to md-bitmap.h and update comments.
>
> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
> ---
>  drivers/md/md-bitmap.c |  9 ---------
>  drivers/md/md-bitmap.h | 17 +++++++++++++++++
>  2 files changed, 17 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index 17d41a7b30ce..689d5dba9328 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -36,15 +36,6 @@
>  #include "md-bitmap.h"
>  #include "md-cluster.h"
>
> -#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
> - * Version 5 is currently set only for clustered devices
> - */
> -#define BITMAP_MAJOR_HI 4
> -#define BITMAP_MAJOR_CLUSTERED 5
> -#define        BITMAP_MAJOR_HOSTENDIAN 3
> -
>  /*
>   * in-memory bitmap:
>   *
> diff --git a/drivers/md/md-bitmap.h b/drivers/md/md-bitmap.h
> index f2d79c8a23b7..d2cdf831ef1a 100644
> --- a/drivers/md/md-bitmap.h
> +++ b/drivers/md/md-bitmap.h
> @@ -18,10 +18,27 @@ typedef __u16 bitmap_counter_t;
>  #define RESYNC_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 2)))
>  #define COUNTER_MAX ((bitmap_counter_t) RESYNC_MASK - 1)
>
> +/*
> + * version 3 is host-endian order, this is deprecated and not used for new
> + * array
> + */
> +#define BITMAP_MAJOR_LO                3
> +#define BITMAP_MAJOR_HOSTENDIAN        3
> +/* version 4 is little-endian order, the default value */
> +#define BITMAP_MAJOR_HI                4
> +/* version 5 is only used for cluster */
> +#define BITMAP_MAJOR_CLUSTERED 5
> +/* version 6 is only used for lockless bitmap */
> +#define BITMAP_MAJOR_LOCKLESS  6
> +
> +#define BITMAP_SB_SIZE 1024

Hi

For super1, the bitmap bits are next to bitmap superblock.
BITMAP_SB_SIZE is only used by md-llbitmap, is it better to define it
in md-llbitmap.c?

Regards
Xiao

>  /* use these for bitmap->flags and bitmap->sb->state bit-fields */
>  enum bitmap_state {
>         BITMAP_STALE       = 1,  /* the bitmap file is out of date or had -EIO */
>         BITMAP_WRITE_ERROR = 2, /* A write error has occurred */
> +       BITMAP_FIRST_USE   = 3, /* llbitmap is just created */
> +       BITMAP_CLEAN       = 4, /* llbitmap is created with assume_clean */
> +       BITMAP_DAEMON_BUSY = 5, /* llbitmap daemon is not finished after daemon_sleep */
>         BITMAP_HOSTENDIAN  =15,
>  };
>
> --
> 2.39.2
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ