Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 648fa60

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: don't return -EINVAL for not found names in devt_from_devname
When we didn't find a device and didn't guess it might be a partition, it might still show up later, so don't disable rootwait for it by returning -EINVAL. Fixes: 079caa3 ("init: clear root_wait on all invalid root= strings") Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 8270cb1 commit 648fa60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block/early-lookup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt)
175175
while (p > s && isdigit(p[-1]))
176176
p--;
177177
if (p == s || !*p || *p == '0')
178-
return -EINVAL;
178+
return -ENODEV;
179179

180180
/* try disk name without <part number> */
181181
part = simple_strtoul(p, NULL, 10);
@@ -186,7 +186,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt)
186186

187187
/* try disk name without p<part number> */
188188
if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p')
189-
return -EINVAL;
189+
return -ENODEV;
190190
p[-1] = '\0';
191191
*devt = blk_lookup_devt(s, part);
192192
if (*devt)

0 commit comments

Comments
 (0)