Re: [PATCH] Remove arbitrary md= boot device limit

Neil Brown (neilb@cse.unsw.edu.au)
Tue, 30 Jan 2001 07:26:39 +1100 (EST)


On Monday January 29, dcinege@psychosis.com wrote:
> linux-2.4.1p11-1/drivers/md/md.c
> line 3643
> -#define MAX_MD_BOOT_DEVS 8
> +#define MAX_MD_BOOT_DEVS MAX_MD_DEVS
>
> -------------------------------------------------------
> To: Dave Cinege <dcinege@psychosis.com>
>
> On Mon, 29 Jan 2001, Dave Cinege wrote:
>
> > -#define MAX_MD_BOOT_DEVS 8
> > +#define MAX_MD_BOOT_DEVS MAX_MD_DEVS
>
> sure this is fine.
>
> Ingo

Actually, this is not fine. Check the code that says:

if (minor >= MAX_MD_BOOT_DEVS) {
printk ("md: Minor device number too high.\n");
return 0;
} else if (md_setup_args.set & (1 << minor)) {
printk ("md: Warning - md=%d,... has been specified twice;\n"
" will discard the first definition.\n", minor);
}
..........
md_setup_args.set |= (1 << minor);

Note that "md_setup_args.set" is an unsigned long.
If minor >= 32, then we wont successfully set a bit in the set, and
things wont work right.

NeilBrown

> -------------------------------------------------------
> To: Ingo Molnar <mingo@redhat.com>
>
> Devices above md8 will not be initialized when speced with md=.
> Error ("md: Minor device number too high.\n");
>
> The limitation is imposed by
> #define MAX_MD_BOOT_DEVS 8
> However it appears arbitray to me. Doesn't make much sence since you can create
> /dev/md100 and it may well be the only md device you have...
>
> Is there any reason the next 2.4.1 prepatch should not include this?
>
> -#define MAX_MD_BOOT_DEVS 8
> +#define MAX_MD_BOOT_DEVS MAX_MD_DEVS
>
> (If not I assume you will be submitting this to Linus...)
>
> --
> "Nobody will ever be safe until the last cop is dead."
> NH Rep. Tom Alciere - (My new Hero)
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/