Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: fix rootwait=

Failures to look up the gendisk must return -ENODEV so that rootwait
retries the lookup instead of -EINVAL which exits early.

Fixes: cf056a431215 ("init: improve the name_to_dev_t interface")
Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20230607135746.92995-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
1341c7d2 3d2af77e

+2 -2
+2 -2
block/early-lookup.c
··· 181 181 *p = '\0'; 182 182 *devt = blk_lookup_devt(s, part); 183 183 if (*devt) 184 - return 0; 184 + return -ENODEV; 185 185 186 186 /* try disk name without p<part number> */ 187 187 if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p') ··· 190 190 *devt = blk_lookup_devt(s, part); 191 191 if (*devt) 192 192 return 0; 193 - return -EINVAL; 193 + return -ENODEV; 194 194 } 195 195 196 196 static int __init devt_from_devnum(const char *name, dev_t *devt)