From: "Masalkhi, Abd Alrhman" <abd.masalkhi@gatech.edu>
To: Mariusz Tkaczyk <mtkaczyk@kernel.org>
Cc: "blazej.kucman@graidtech.com" <blazej.kucman@graidtech.com>,
"ncroxon@redhat.com" <ncroxon@redhat.com>,
"xni@redhat.com" <xni@redhat.com>,
"song@kernel.org" <song@kernel.org>,
"yukuai@kernel.org" <yukuai@kernel.org>,
"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>
Subject: Re: [PATCH] mdadm: Deprecate the obsolete --auto-detect option
Date: Wed, 28 Oct 2026 12:52:30 +0000 [thread overview]
Message-ID: <m25wym2diq.fsf@gmail.com> (raw)
In-Reply-To: <20261028100317.3b964788@kernel.org>
Hi Mariusz,
On Wed, Oct 28, 2026 at 10:03 +0100, Mariusz Tkaczyk wrote:
> On Thu, 15 Oct 2026 13:03:59 +0000
> "Masalkhi, Abd Alrhman" <abd.masalkhi@gatech.edu> wrote:
>
>> From: Abd-Alrhman Masalkhi <abd.masalkhi@gatech.edu>
>>
>> --auto-detect opened md0 (9:0) and issued the RAID_AUTORUN ioctl to
>> ask the kernel to start the arrays it had auto-detected. The kernel
>> removed this ioctl in commit d82fa81c2364 ("md: replace the
>> RAID_AUTORUN ioctl with a direct function call"). Before that, it
>> worked only when md was built into the kernel. Since then, md_ioctl()
>
> Redhat still builds-in md into kernel so there is chance that someone
> is using it.
>
>
>> has rejected it with ENOTTY, making --auto-detect ineffective on
>> current kernels.
>
>
> Hello,
> Do you mind to submit github PRs for mdadm patches?
> https://github.com/md-raid-utilities/mdadm
>
Sure, I will submit the next version as a GitHub pull request.
One question, should I also send the RFC patches for updating mdadm to
use the new UAPI to the mailing list, or is submitting GitHub PRs
sufficient?
> mdadm community is the most active over the github today.
>
> Indeed, it has been removed 6 years ago. The question is if 6 years is
> enough to stop supporting the configurations with new mdadm and old
> kernel. I think it is not enough.
>
> I would do that at least 10 years after kernel part removed.
>
> What can be done here is warning and improved error message saying that
> "The option is deprecated and probably it is not supported with this
> kernel". If you wish you can be more detailed and add validation
> against kernel version but I have no hard feeling to that. It is minor
> case, probably not used because no one ever complained about the removed
> ioctl.
>
> You can left some TODO message saying that after 2030y it can
> removed- that would be helpful for future maintainers.
>
Thanks for the clarification. I will make the changes accordingly.
> Thanks,
> Mariusz
>
>>
>> Remove autodetect(). Keep the option for now to avoid breaking
>> existing scripts, and print a warning message when it is used.
>>
>> Signed-off-by: Abd-Alrhman Masalkhi <abd.masalkhi@gatech.edu>
>> ---
>> Manage.c | 13 -------------
>> mdadm.c | 2 +-
>> mdadm.h | 1 -
>> 3 files changed, 1 insertion(+), 15 deletions(-)
>>
>> diff --git a/Manage.c b/Manage.c
>> index 40d52cfc..d38336a0 100644
>> --- a/Manage.c
>> +++ b/Manage.c
>> @@ -1738,19 +1738,6 @@ abort:
>> return !test && busy ? 2 : 1;
>> }
>>
>> -int autodetect(void)
>> -{
>> - /* Open any md device, and issue the RAID_AUTORUN ioctl */
>> - int rv = 1;
>> - int fd = dev_open("9:0", O_RDONLY);
>> - if (fd >= 0) {
>> - if (ioctl(fd, RAID_AUTORUN, 0) == 0)
>> - rv = 0;
>> - close_fd(&fd);
>> - }
>> - return rv;
>> -}
>> -
>> int Update_subarray(char *dev, char *subarray, enum update_opt
>> update, struct mddev_ident *ident, int verbose)
>> {
>> diff --git a/mdadm.c b/mdadm.c
>> index 2517b037..c4e234e3 100644
>> --- a/mdadm.c
>> +++ b/mdadm.c
>> @@ -1744,7 +1744,7 @@ int main(int argc, char *argv[])
>> rv = Incremental(devlist, &c, ss);
>> break;
>> case AUTODETECT:
>> - autodetect();
>> + pr_err("--auto-detect has no effect. It is
>> deprecated and will be removed in future releases.\n"); break;
>> }
>> if (ss) {
>> diff --git a/mdadm.h b/mdadm.h
>> index deac7a56..985951d3 100644
>> --- a/mdadm.h
>> +++ b/mdadm.h
>> @@ -1434,7 +1434,6 @@ extern int Manage_stop(char *devname, int fd,
>> int quiet, extern int Manage_subdevs(char *devname, int fd,
>> struct mddev_dev *devlist, int verbose,
>> int test, enum update_opt update, int force);
>> -extern int autodetect(void);
>> extern int Grow_Add_device(char *devname, int fd, char *newdev);
>> extern int Grow_addbitmap(char *devname, int fd,
>> struct context *c, struct shape *s);
>
>
--
Best Regards,
Abd-Alrhman
next prev parent reply other threads:[~2026-10-28 12:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 13:03 [PATCH] mdadm: Deprecate the obsolete --auto-detect option Masalkhi, Abd Alrhman
2026-10-28 9:03 ` Mariusz Tkaczyk
2026-10-28 12:52 ` Masalkhi, Abd Alrhman [this message]
2026-10-28 14:00 ` Mariusz Tkaczyk
2026-10-28 16:37 ` 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=m25wym2diq.fsf@gmail.com \
--to=abd.masalkhi@gatech.edu \
--cc=blazej.kucman@graidtech.com \
--cc=linux-raid@vger.kernel.org \
--cc=mtkaczyk@kernel.org \
--cc=ncroxon@redhat.com \
--cc=song@kernel.org \
--cc=xni@redhat.com \
--cc=yukuai@kernel.org \
/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