From: Christoph Hellwig Date: Thu, 22 Jun 2023 15:06:44 +0000 (+0200) Subject: block: don't return -EINVAL for not found names in devt_from_devname X-Git-Tag: v6.6.7~2607^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=648fa60fa7de3ca6f6303e1721591ad73def9cf0;p=platform%2Fkernel%2Flinux-starfive.git 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: 079caa35f786 ("init: clear root_wait on all invalid root= strings") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20230622150644.600327-1-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/block/early-lookup.c b/block/early-lookup.c index 91002b1..3effbd0 100644 --- a/block/early-lookup.c +++ b/block/early-lookup.c @@ -175,7 +175,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt) while (p > s && isdigit(p[-1])) p--; if (p == s || !*p || *p == '0') - return -EINVAL; + return -ENODEV; /* try disk name without */ part = simple_strtoul(p, NULL, 10); @@ -186,7 +186,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt) /* try disk name without p */ if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p') - return -EINVAL; + return -ENODEV; p[-1] = '\0'; *devt = blk_lookup_devt(s, part); if (*devt)