diff options
Diffstat (limited to 'init/do_mounts.c')
-rw-r--r-- | init/do_mounts.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c index b28ec5819325..c950d7c93f98 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
@@ -119,27 +119,29 @@ static dev_t devt_from_partuuid(const char *uuid_str) | |||
119 | struct gendisk *disk; | 119 | struct gendisk *disk; |
120 | struct hd_struct *part; | 120 | struct hd_struct *part; |
121 | int offset = 0; | 121 | int offset = 0; |
122 | 122 | bool clear_root_wait = false; | |
123 | if (strlen(uuid_str) < 36) | 123 | char *slash; |
124 | goto done; | ||
125 | 124 | ||
126 | cmp.uuid = uuid_str; | 125 | cmp.uuid = uuid_str; |
127 | cmp.len = 36; | ||
128 | 126 | ||
127 | slash = strchr(uuid_str, '/'); | ||
129 | /* Check for optional partition number offset attributes. */ | 128 | /* Check for optional partition number offset attributes. */ |
130 | if (uuid_str[36]) { | 129 | if (slash) { |
131 | char c = 0; | 130 | char c = 0; |
132 | /* Explicitly fail on poor PARTUUID syntax. */ | 131 | /* Explicitly fail on poor PARTUUID syntax. */ |
133 | if (sscanf(&uuid_str[36], | 132 | if (sscanf(slash + 1, |
134 | "/PARTNROFF=%d%c", &offset, &c) != 1) { | 133 | "PARTNROFF=%d%c", &offset, &c) != 1) { |
135 | printk(KERN_ERR "VFS: PARTUUID= is invalid.\n" | 134 | clear_root_wait = true; |
136 | "Expected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n"); | ||
137 | if (root_wait) | ||
138 | printk(KERN_ERR | ||
139 | "Disabling rootwait; root= is invalid.\n"); | ||
140 | root_wait = 0; | ||
141 | goto done; | 135 | goto done; |
142 | } | 136 | } |
137 | cmp.len = slash - uuid_str; | ||
138 | } else { | ||
139 | cmp.len = strlen(uuid_str); | ||
140 | } | ||
141 | |||
142 | if (!cmp.len) { | ||
143 | clear_root_wait = true; | ||
144 | goto done; | ||
143 | } | 145 | } |
144 | 146 | ||
145 | dev = class_find_device(&block_class, NULL, &cmp, | 147 | dev = class_find_device(&block_class, NULL, &cmp, |
@@ -164,6 +166,13 @@ static dev_t devt_from_partuuid(const char *uuid_str) | |||
164 | no_offset: | 166 | no_offset: |
165 | put_device(dev); | 167 | put_device(dev); |
166 | done: | 168 | done: |
169 | if (clear_root_wait) { | ||
170 | pr_err("VFS: PARTUUID= is invalid.\n" | ||
171 | "Expected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n"); | ||
172 | if (root_wait) | ||
173 | pr_err("Disabling rootwait; root= is invalid.\n"); | ||
174 | root_wait = 0; | ||
175 | } | ||
167 | return res; | 176 | return res; |
168 | } | 177 | } |
169 | #endif | 178 | #endif |