* [PATCH] block: don't return -EINVAL for not found names in devt_from_devname
@ 2023-06-22 15:06 Christoph Hellwig
2023-06-22 15:09 ` Jens Axboe
2023-06-22 18:47 ` Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-06-22 15:06 UTC (permalink / raw
To: axboe; +Cc: linux-block, Guenter Roeck
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 <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/early-lookup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/early-lookup.c b/block/early-lookup.c
index a5be3c68ed079c..9e2d5a19de1b3b 100644
--- a/block/early-lookup.c
+++ b/block/early-lookup.c
@@ -174,7 +174,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 number> */
part = simple_strtoul(p, NULL, 10);
@@ -185,7 +185,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt)
/* try disk name without p<part number> */
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)
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] block: don't return -EINVAL for not found names in devt_from_devname
2023-06-22 15:06 [PATCH] block: don't return -EINVAL for not found names in devt_from_devname Christoph Hellwig
@ 2023-06-22 15:09 ` Jens Axboe
2023-06-22 18:47 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2023-06-22 15:09 UTC (permalink / raw
To: Christoph Hellwig; +Cc: linux-block, Guenter Roeck
On Thu, 22 Jun 2023 17:06:44 +0200, Christoph Hellwig wrote:
> 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.
>
>
Applied, thanks!
[1/1] block: don't return -EINVAL for not found names in devt_from_devname
commit: 648fa60fa7de3ca6f6303e1721591ad73def9cf0
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block: don't return -EINVAL for not found names in devt_from_devname
2023-06-22 15:06 [PATCH] block: don't return -EINVAL for not found names in devt_from_devname Christoph Hellwig
2023-06-22 15:09 ` Jens Axboe
@ 2023-06-22 18:47 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2023-06-22 18:47 UTC (permalink / raw
To: Christoph Hellwig, axboe; +Cc: linux-block
On 6/22/23 08:06, Christoph Hellwig wrote:
> 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 <linux@roeck-us.net>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Guenter Roeck <linux@roeck-us.net>
> ---
> block/early-lookup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block/early-lookup.c b/block/early-lookup.c
> index a5be3c68ed079c..9e2d5a19de1b3b 100644
> --- a/block/early-lookup.c
> +++ b/block/early-lookup.c
> @@ -174,7 +174,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 number> */
> part = simple_strtoul(p, NULL, 10);
> @@ -185,7 +185,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt)
>
> /* try disk name without p<part number> */
> 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)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-22 18:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-22 15:06 [PATCH] block: don't return -EINVAL for not found names in devt_from_devname Christoph Hellwig
2023-06-22 15:09 ` Jens Axboe
2023-06-22 18:47 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).