@@ -112,14 +112,14 @@ static int devt_from_partuuid(const char *uuid_str, dev_t *devt)
112
112
113
113
/* Explicitly fail on poor PARTUUID syntax. */
114
114
if (sscanf (slash + 1 , "PARTNROFF=%d%c" , & offset , & c ) != 1 )
115
- goto clear_root_wait ;
115
+ goto out_invalid ;
116
116
cmp .len = slash - uuid_str ;
117
117
} else {
118
118
cmp .len = strlen (uuid_str );
119
119
}
120
120
121
121
if (!cmp .len )
122
- goto clear_root_wait ;
122
+ goto out_invalid ;
123
123
124
124
dev = class_find_device (& block_class , NULL , & cmp , & match_dev_by_uuid );
125
125
if (!dev )
@@ -139,12 +139,9 @@ static int devt_from_partuuid(const char *uuid_str, dev_t *devt)
139
139
put_device (dev );
140
140
return 0 ;
141
141
142
- clear_root_wait :
142
+ out_invalid :
143
143
pr_err ("VFS: PARTUUID= is invalid.\n"
144
144
"Expected PARTUUID=<valid-uuid-id>[/PARTNROFF=%%d]\n" );
145
- if (root_wait )
146
- pr_err ("Disabling rootwait; root= is invalid.\n" );
147
- root_wait = 0 ;
148
145
return - EINVAL ;
149
146
}
150
147
@@ -611,6 +608,7 @@ static void __init wait_for_root(char *root_device_name)
611
608
612
609
static dev_t __init parse_root_device (char * root_device_name )
613
610
{
611
+ int error ;
614
612
dev_t dev ;
615
613
616
614
if (!strncmp (root_device_name , "mtd" , 3 ) ||
@@ -623,8 +621,14 @@ static dev_t __init parse_root_device(char *root_device_name)
623
621
if (strcmp (root_device_name , "/dev/ram" ) == 0 )
624
622
return Root_RAM0 ;
625
623
626
- if (early_lookup_bdev (root_device_name , & dev ))
624
+ error = early_lookup_bdev (root_device_name , & dev );
625
+ if (error ) {
626
+ if (error == - EINVAL && root_wait ) {
627
+ pr_err ("Disabling rootwait; root= is invalid.\n" );
628
+ root_wait = 0 ;
629
+ }
627
630
return 0 ;
631
+ }
628
632
return dev ;
629
633
}
630
634
0 commit comments