Linux RAID subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Masalkhi, Abd Alrhman" <abd.masalkhi@gatech.edu>
Cc: linux-raid@vger.kernel.org, yukuai@fygo.io
Subject: Re: [RFC PATCH v3 3/4] md: use struct mdu_array_info64 for SET_ARRAY_INFO
Date: Wed, 07 Oct 2026 12:01:19 +0000	[thread overview]
Message-ID: <sashiko-outbox-162963@kernel.org> (raw)
In-Reply-To: <20261007115104.13884-4-abd.masalkhi@gatech.edu>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] md: format string mismatch for major_version in pr_warn
--

commit 4b1b8271e62fda3b747c4ac07bffdb6f7582ebcf
Author: Abd-Alrhman Masalkhi <abd.masalkhi@gatech.edu>

md: use struct mdu_array_info64 for SET_ARRAY_INFO

The md control device passes array information as struct mdu_array_info64.
Make md_set_array_info() and update_array_info() take the new struct
mdu_array_info64, so that the md control device and the old SET_ARRAY_INFO
ioctl can share them. md_set_array_info() no longer checks for a negative
major_version since the field is unsigned now.

> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index be1634ae1d09c..63b9468285b09 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -7904,12 +7904,11 @@ static int set_bitmap_file(struct mddev *mddev, int fd)
>   *  The minor and patch _version numbers are also kept incase the
>   *  super_block handler wishes to interpret them.
>   */
> -int md_set_array_info(struct mddev *mddev, struct mdu_array_info_s *info)
> +int md_set_array_info(struct mddev *mddev, struct mdu_array_info64 *info)
>  {
>  	if (info->raid_disks == 0) {
>  		/* just setting version number for superblock loading */
> -		if (info->major_version < 0 ||
> -		    info->major_version >= ARRAY_SIZE(super_types) ||
> +		if (info->major_version >= ARRAY_SIZE(super_types) ||
>  		    super_types[info->major_version].name == NULL) {
>  			/* maybe try to auto-load a module? */
>  			pr_warn("md: superblock version %d not known\n",
>  				info->major_version);

[Severity: Low]
Is there a format string mismatch here?

Since info->major_version is now an unsigned __u32 type, should the format
specifier in this warning be updated from %d to %u? A large unsigned value
provided by userspace could incorrectly print as a negative number.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261007115104.13884-1-abd.masalkhi@gatech.edu?part=3

  reply	other threads:[~2026-10-07 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 11:51 [RFC PATCH v3 0/4] md: add a control device for array management Masalkhi, Abd Alrhman
2026-10-07 11:51 ` [RFC PATCH v3 1/4] md: add uapi definitions for the md control device Masalkhi, Abd Alrhman
2026-10-07 11:51 ` [RFC PATCH v3 2/4] md: pass struct mdu_disk_info64 to md_add_new_disk() Masalkhi, Abd Alrhman
2026-10-07 12:08   ` sashiko-bot
2026-10-07 11:52 ` [RFC PATCH v3 3/4] md: use struct mdu_array_info64 for SET_ARRAY_INFO Masalkhi, Abd Alrhman
2026-10-07 12:01   ` sashiko-bot [this message]
2026-10-07 11:52 ` [RFC PATCH v3 4/4] md: add a control device for array management Masalkhi, Abd Alrhman
2026-10-07 12:09   ` sashiko-bot
2026-10-07 18:09     ` Masalkhi, Abd Alrhman

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-162963@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=abd.masalkhi@gatech.edu \
    --cc=linux-raid@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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