Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: init/do_mounts_dm.c

Issue 3059004: CHROMIUM: make dm= boot path wait for devices (Closed) Base URL: http://src.chromium.org/git/kernel.git
Patch Set: fix unused var Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: init/do_mounts_dm.c
diff --git a/init/do_mounts_dm.c b/init/do_mounts_dm.c
index a574b98ea333c48171ddea0533437522637e8c03..8e7b6790b4fbbeed1b194fdf6fa1da4aaeb9daf3 100644
--- a/init/do_mounts_dm.c
+++ b/init/do_mounts_dm.c
@@ -5,6 +5,7 @@
*
* This file is released under the GPL.
*/
+#include <linux/async.h>
#include <linux/device-mapper.h>
#include <linux/fs.h>
#include <linux/string.h>
@@ -199,9 +200,21 @@ static void __init dm_substitute_devices(char *str, size_t str_len)
DMDEBUG("converting candidate device '%s' to dev_t", candidate);
/* Use the boot-time specific device naming */
dev = name_to_dev_t(candidate);
- *candidate_end = old_char;
+ /* If it failed, but the candidate starts with /dev/, then try
+ * after device probing ends.
+ */
+ if (!dev && strncmp(candidate, "/dev/", 5) == 0) {
+ DMINFO("waiting to resolve device '%s'...",
+ candidate);
+ while (driver_probe_done() != 0 ||
+ (dev = name_to_dev_t(candidate)) == 0)
+ msleep(100);
+ async_synchronize_full();
+ }
DMDEBUG(" -> %u", dev);
+
+ *candidate_end = old_char;
/* No suitable replacement found */
if (!dev)
continue;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698