aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2003-02-21 11:53:43 -0600
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2003-02-21 11:53:43 -0600
commitcfc5a5b45c18760c612c01220d0001d2a4d0ca9a (patch)
tree311d58f41ec7357a993aa67b10e8d6742dcc3bef /init
parent2039955ca2ccc9b98be0053ba670676b26a2f32a (diff)
downloadhistory-cfc5a5b45c18760c612c01220d0001d2a4d0ca9a.tar.gz
do_mounts: fix device name recognition for md= command line option
As we all know, strncmp() returns 0 for match... Obviously nobody uses this codepath since it never worked, but let's fix it anyway.
Diffstat (limited to 'init')
-rw-r--r--init/do_mounts_md.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index 4da148027c8754..a3444e771718fa 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -12,10 +12,7 @@
* The code for that is here.
*/
-struct {
- int set;
- int noautodetect;
-} raid_setup_args __initdata;
+static int __initdata raid_noautodetect;
static struct {
char device_set [MAX_MD_DEVS];
@@ -104,6 +101,7 @@ static int __init md_setup(char *str)
return 1;
}
+
static void __init md_setup_drive(void)
{
int minor, i;
@@ -133,7 +131,7 @@ static void __init md_setup_drive(void)
*p++ = 0;
dev = name_to_dev_t(devname);
- if (strncmp(devname, "/dev/", 5))
+ if (strncmp(devname, "/dev/", 5) == 0)
devname += 5;
snprintf(comp_name, 63, "/dev/%s", devname);
if (sys_newstat(comp_name, &buf) == 0 &&
@@ -230,10 +228,9 @@ static int __init raid_setup(char *str)
else wlen = (len-1)-pos;
if (!strncmp(str, "noautodetect", wlen))
- raid_setup_args.noautodetect = 1;
+ raid_noautodetect = 1;
pos += wlen+1;
}
- raid_setup_args.set = 1;
return 1;
}
@@ -243,7 +240,7 @@ __setup("md=", md_setup);
void __init md_run_setup(void)
{
create_dev("/dev/md0", MKDEV(MD_MAJOR, 0), "md/0");
- if (raid_setup_args.noautodetect)
+ if (raid_noautodetect)
printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n");
else {
int fd = open("/dev/md0", 0, 0);