aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--init/do_mounts_md.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index 1ec5c41c8a3c..c0dfd3c1e91b 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -264,26 +264,32 @@ static int __init raid_setup(char *str)
264__setup("raid=", raid_setup); 264__setup("raid=", raid_setup);
265__setup("md=", md_setup); 265__setup("md=", md_setup);
266 266
267static void autodetect_raid(void)
268{
269 int fd;
270
271 /*
272 * Since we don't want to detect and use half a raid array, we need to
273 * wait for the known devices to complete their probing
274 */
275 printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
276 printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
277 while (driver_probe_done() < 0)
278 msleep(100);
279 fd = sys_open("/dev/md0", 0, 0);
280 if (fd >= 0) {
281 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
282 sys_close(fd);
283 }
284}
285
267void __init md_run_setup(void) 286void __init md_run_setup(void)
268{ 287{
269 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0)); 288 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));
270 289
271 if (raid_noautodetect) 290 if (raid_noautodetect)
272 printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n"); 291 printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n");
273 else { 292 else
274 /* 293 autodetect_raid();
275 * Since we don't want to detect and use half a raid array, we need to
276 * wait for the known devices to complete their probing
277 */
278 printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
279 printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
280 while (driver_probe_done() < 0)
281 msleep(100);
282 int fd = sys_open("/dev/md0", 0, 0);
283 if (fd >= 0) {
284 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
285 sys_close(fd);
286 }
287 }
288 md_setup_drive(); 294 md_setup_drive();
289} 295}