Re: rootwait regression in linux-next

From: Fabio Estevam
Date: Wed Jun 07 2023 - 08:05:51 EST


Hi Christoph,

On Wed, Jun 7, 2023 at 2:38 AM Christoph Hellwig <hch@xxxxxx> wrote:
>
> Hi Fabio,
>
> can you try this patch?
>
> diff --git a/block/early-lookup.c b/block/early-lookup.c
> index 3ff0d2e4dcbfb8..ca3b4f494c9330 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 -ENOENT;

Unfortunately, it does not help.

I have added some debug prints:

--- a/block/early-lookup.c
+++ b/block/early-lookup.c
@@ -157,15 +157,21 @@ static int __init devt_from_devname(const char
*name, dev_t *devt)

if (strlen(name) > 31)
return -EINVAL;
+
+ pr_err("***** %s: 1\n", __func__);
strcpy(s, name);
for (p = s; *p; p++) {
if (*p == '/')
*p = '!';
}
+
+ pr_err("***** %s: 2\n", __func__);

*devt = blk_lookup_devt(s, 0);
if (*devt)
return 0;
+
+ pr_err("***** %s: 3\n", __func__);

/*
* Try non-existent, but valid partition, which may only exist after
@@ -174,7 +180,9 @@ 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 -ENOENT;
+
+ pr_err("***** %s: 4\n", __func__);

/* try disk name without <part number> */
part = simple_strtoul(p, NULL, 10);
@@ -182,14 +190,18 @@ static int __init devt_from_devname(const char
*name, dev_t *devt)
*devt = blk_lookup_devt(s, part);
if (*devt)
return 0;
+
+ pr_err("***** %s: 5\n", __func__);

/* try disk name without p<part number> */
if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p')
return -EINVAL;
+ pr_err("***** %s: 6\n", __func__);
p[-1] = '\0';
*devt = blk_lookup_devt(s, part);
if (*devt)
return 0;
+ pr_err("***** %s: 7\n", __func__);
return -EINVAL;
}

[ 1.627144] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] using ADMA
[ 1.629380] mmcblk2rpmb: mmc2:0001 DG4016 4.00 MiB, chardev (241:0)
[ 1.664895] ***** devt_from_devname: 1
[ 1.668681] ***** devt_from_devname: 2
[ 1.672467] ***** devt_from_devname: 3
[ 1.676230] ***** devt_from_devname: 4
[ 1.680011] ***** devt_from_devname: 5
[ 1.683778] ***** devt_from_devname: 6
[ 1.687546] ***** devt_from_devname: 7
[ 1.691314] Disabling rootwait; root= is invalid.
[ 1.696842] /dev/root: Can't open blockdev
[ 1.700988] VFS: Cannot open root device "/dev/mmcblk1p1" or
unknown-block(0,0): error -6

Let me know if you need me to run more debugging tests.