Linux RAID subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Eric Curtin" <ericcurtin17@gmail.com>
Cc: "Eric Curtin" <eric.curtin@docker.com>,
	"Coly Li" <colyli@fygo.io>,
	"Kent Overstreet" <kent.overstreet@linux.dev>,
	"Alasdair Kergon" <agk@redhat.com>,
	"Mike Snitzer" <snitzer@kernel.org>,
	"Mikulas Patocka" <mpatocka@redhat.com>,
	"Benjamin Marzinski" <bmarzins@redhat.com>,
	"Matthew Sakai" <msakai@redhat.com>, "Song Liu" <song@kernel.org>,
	"Yu Kuai" <yukuai@fygo.io>, "Li Nan" <magiclinan@didiglobal.com>,
	"Xiao Ni" <xiao@kernel.org>,
	dm-devel@lists.linux.dev, linux-raid@vger.kernel.org
Subject: Re: [RFC PATCH v2 04/13] md: Remove compile-time PAGE_SIZE use in md, dm and bcache
Date: Thu, 03 Dec 2026 03:17:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-247076@kernel.org> (raw)
In-Reply-To: <20261202031647.1690622-5-ericcurtin17@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] md: undeclared PAGE_SIZE_MIN and PAGE_SIZE_MAX break build and
  raid5
--

commit 0a07d2a3191fb11978a042ddd22829ad375b5c83
Author: Eric Curtin <eric.curtin@docker.com>

md: Remove compile-time PAGE_SIZE use in md, dm and bcache

This commit replaces compile-time uses of PAGE_SIZE and PAGE_SHIFT in
bcache, dm-switch, dm-vdo, dm-writecache, raid1/10, and raid5 to support
boot-time page size selection.

> diff --git a/drivers/md/dm-vdo/data-vio.c b/drivers/md/dm-vdo/data-vio.c
> index 370d4239ba315..fe0329354cfba 100644
> --- a/drivers/md/dm-vdo/data-vio.c
> +++ b/drivers/md/dm-vdo/data-vio.c
> @@ -785,7 +785,7 @@ static int initialize_data_vio(struct data_vio *data_vio, struct vdo *vdo)
>  	struct bio *bio;
>  	int result;
>  
> -	BUILD_BUG_ON(VDO_BLOCK_SIZE > PAGE_SIZE);
> +	BUILD_BUG_ON(VDO_BLOCK_SIZE > PAGE_SIZE_MIN);
>  	result = vdo_allocate_memory(VDO_BLOCK_SIZE, 0, "data_vio data",
>  				     &data_vio->vio.data);
>  	if (result != VDO_SUCCESS)
> diff --git a/drivers/md/raid1-10.c b/drivers/md/raid1-10.c
> index 341a9785e3f26..919de6611ee3a 100644
> --- a/drivers/md/raid1-10.c
> +++ b/drivers/md/raid1-10.c
> @@ -2,6 +2,7 @@
>  /* Maximum size of each resync request */
>  #define RESYNC_BLOCK_SIZE (64*1024)
>  #define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
> +#define RESYNC_PAGES_MAX ((RESYNC_BLOCK_SIZE + PAGE_SIZE_MIN-1) / PAGE_SIZE_MIN)
>  
>  /* when we get a read error on a read-only array, we redirect to another
>   * device without failing the first device, or trying to over-write to
> @@ -21,7 +22,7 @@
>  /* for managing resync I/O pages */
>  struct resync_pages {
>  	void		*raid_bio;
> -	struct page	*pages[RESYNC_PAGES];
> +	struct page	*pages[RESYNC_PAGES_MAX];
>  };
>  
>  struct raid1_plug_cb {

[ ... ]

> diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
> index 94b3e2c947ba9..0f87b58a9a617 100644
> --- a/drivers/md/raid5.h
> +++ b/drivers/md/raid5.h
> @@ -197,6 +197,9 @@ enum reconstruct_states {
>  };
>  
>  #define DEFAULT_STRIPE_SIZE	4096
> +#if PAGE_SIZE_MIN != DEFAULT_STRIPE_SIZE || PAGE_SIZE_MAX != DEFAULT_STRIPE_SIZE
> +#define RAID5_VAR_STRIPE_SIZE
> +#endif

[Severity: High]
Are PAGE_SIZE_MIN and PAGE_SIZE_MAX defined anywhere in the tree?

Neither macro is defined in the headers, so compiling with CONFIG_DM_VDO,
CONFIG_MD_RAID1, or CONFIG_MD_RAID10 fails with undeclared identifier
errors in initialize_data_vio(), struct resync_pages, and
process_checks().

In raid5.h, the #if directive evaluates both undefined identifiers to 0
(triggering -Wundef warnings, or build failures with CONFIG_WERROR), which
unconditionally defines RAID5_VAR_STRIPE_SIZE even on architectures with a
fixed 4096-byte PAGE_SIZE.  That turns RAID5_STRIPE_SIZE(),
RAID5_STRIPE_SHIFT(), and RAID5_STRIPE_SECTORS() into runtime loads from
struct r5conf, allocates an extra sh->pages array per stripe_head in
alloc_stripe(), and exposes a writable stripe_size sysfs attribute via
raid5_store_stripe_size().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202031647.1690622-1-ericcurtin17@gmail.com?part=4

      reply	other threads:[~2026-12-03  3:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261202031647.1690622-1-ericcurtin17@gmail.com>
2026-12-02  3:16 ` [RFC PATCH v2 04/13] md: Remove compile-time PAGE_SIZE use in md, dm and bcache Eric Curtin
2026-12-03  3:17   ` sashiko-bot [this message]

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=sashiko-outbox-247076@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=agk@redhat.com \
    --cc=bmarzins@redhat.com \
    --cc=colyli@fygo.io \
    --cc=dm-devel@lists.linux.dev \
    --cc=eric.curtin@docker.com \
    --cc=ericcurtin17@gmail.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-raid@vger.kernel.org \
    --cc=magiclinan@didiglobal.com \
    --cc=mpatocka@redhat.com \
    --cc=msakai@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=snitzer@kernel.org \
    --cc=song@kernel.org \
    --cc=xiao@kernel.org \
    --cc=yukuai@fygo.io \
    /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