Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346285
b: refs/heads/master
c: 283f8fc
h: refs/heads/master
i:
  346283: d5df952
v: v3
  • Loading branch information
Stephen Warren authored and Jens Axboe committed Nov 23, 2012
1 parent 786b591 commit 95cc296
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ad7e89940d5ac411928189e1a4a01901dbf590f
refs/heads/master: 283f8fc03927b0ef42a2faa60a0df5ec8c612edb
35 changes: 22 additions & 13 deletions trunk/init/do_mounts.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,29 @@ static dev_t devt_from_partuuid(const char *uuid_str)
struct gendisk *disk;
struct hd_struct *part;
int offset = 0;

if (strlen(uuid_str) < 36)
goto done;
bool clear_root_wait = false;
char *slash;

cmp.uuid = uuid_str;
cmp.len = 36;

slash = strchr(uuid_str, '/');
/* Check for optional partition number offset attributes. */
if (uuid_str[36]) {
if (slash) {
char c = 0;
/* Explicitly fail on poor PARTUUID syntax. */
if (sscanf(&uuid_str[36],
"/PARTNROFF=%d%c", &offset, &c) != 1) {
printk(KERN_ERR "VFS: PARTUUID= is invalid.\n"
"Expected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n");
if (root_wait)
printk(KERN_ERR
"Disabling rootwait; root= is invalid.\n");
root_wait = 0;
if (sscanf(slash + 1,
"PARTNROFF=%d%c", &offset, &c) != 1) {
clear_root_wait = true;
goto done;
}
cmp.len = slash - uuid_str;
} else {
cmp.len = strlen(uuid_str);
}

if (!cmp.len) {
clear_root_wait = true;
goto done;
}

dev = class_find_device(&block_class, NULL, &cmp,
Expand All @@ -164,6 +166,13 @@ static dev_t devt_from_partuuid(const char *uuid_str)
no_offset:
put_device(dev);
done:
if (clear_root_wait) {
pr_err("VFS: PARTUUID= is invalid.\n"
"Expected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n");
if (root_wait)
pr_err("Disabling rootwait; root= is invalid.\n");
root_wait = 0;
}
return res;
}
#endif
Expand Down

0 comments on commit 95cc296

Please sign in to comment.