Commit 31647d19 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md: make md work a bit better with devfs

- set ->devfs_name
- create initial devfs names slightly differently so
  as not to conflict
- re-read partition table when an array is assembled at boot
  time - not sure why this is needed, but it is.
Signed-off-by: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 061e7151
...@@ -1473,10 +1473,13 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data) ...@@ -1473,10 +1473,13 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
} }
disk->major = MAJOR(dev); disk->major = MAJOR(dev);
disk->first_minor = unit << shift; disk->first_minor = unit << shift;
if (partitioned) if (partitioned) {
sprintf(disk->disk_name, "md_d%d", unit); sprintf(disk->disk_name, "md_d%d", unit);
else sprintf(disk->devfs_name, "md/d%d", unit);
} else {
sprintf(disk->disk_name, "md%d", unit); sprintf(disk->disk_name, "md%d", unit);
sprintf(disk->devfs_name, "md/%d", unit);
}
disk->fops = &md_fops; disk->fops = &md_fops;
disk->private_data = mddev; disk->private_data = mddev;
disk->queue = mddev->queue; disk->queue = mddev->queue;
...@@ -3659,7 +3662,7 @@ int __init md_init(void) ...@@ -3659,7 +3662,7 @@ int __init md_init(void)
for (minor=0; minor < MAX_MD_DEVS; ++minor) for (minor=0; minor < MAX_MD_DEVS; ++minor)
devfs_mk_bdev(MKDEV(mdp_major, minor<<MdpMinorShift), devfs_mk_bdev(MKDEV(mdp_major, minor<<MdpMinorShift),
S_IFBLK|S_IRUSR|S_IWUSR, S_IFBLK|S_IRUSR|S_IWUSR,
"md/d%d", minor); "md/mdp%d", minor);
register_reboot_notifier(&md_notifier); register_reboot_notifier(&md_notifier);
......
...@@ -232,6 +232,16 @@ static void __init md_setup_drive(void) ...@@ -232,6 +232,16 @@ static void __init md_setup_drive(void)
err = sys_ioctl(fd, RUN_ARRAY, 0); err = sys_ioctl(fd, RUN_ARRAY, 0);
if (err) if (err)
printk(KERN_WARNING "md: starting md%d failed\n", minor); printk(KERN_WARNING "md: starting md%d failed\n", minor);
else {
/* reread the partition table.
* I (neilb) and not sure why this is needed, but I cannot
* boot a kernel with devfs compiled in from partitioned md
* array without it
*/
sys_close(fd);
fd = sys_open(name, 0, 0);
sys_ioctl(fd, BLKRRPART, 0);
}
sys_close(fd); sys_close(fd);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment