/* Explicitly fail on poor PARTUUID syntax. */
if (sscanf(slash + 1, "PARTNROFF=%d%c", &offset, &c) != 1)
- goto clear_root_wait;
+ goto out_invalid;
cmp.len = slash - uuid_str;
} else {
cmp.len = strlen(uuid_str);
}
if (!cmp.len)
- goto clear_root_wait;
+ goto out_invalid;
dev = class_find_device(&block_class, NULL, &cmp, &match_dev_by_uuid);
if (!dev)
put_device(dev);
return 0;
-clear_root_wait:
+out_invalid:
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 -EINVAL;
}
static dev_t __init parse_root_device(char *root_device_name)
{
+ int error;
dev_t dev;
if (!strncmp(root_device_name, "mtd", 3) ||
if (strcmp(root_device_name, "/dev/ram") == 0)
return Root_RAM0;
- if (early_lookup_bdev(root_device_name, &dev))
+ error = early_lookup_bdev(root_device_name, &dev);
+ if (error) {
+ if (error == -EINVAL && root_wait) {
+ pr_err("Disabling rootwait; root= is invalid.\n");
+ root_wait = 0;
+ }
return 0;
+ }
return dev;
}