dm: open code dm_get_dev_t in dm_init_init
authorChristoph Hellwig <hch@lst.de>
Wed, 31 May 2023 12:55:29 +0000 (14:55 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 5 Jun 2023 16:57:40 +0000 (10:57 -0600)
dm_init_init is called from early boot code, and thus lookup_bdev
will never succeed.  Just open code that call to early_lookup_bdev
instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Snitzer <snitzer@kernel.org>
Link: https://lore.kernel.org/r/20230531125535.676098-19-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/dm-init.c

index d369457dbed0ed5b5c6a2be0b995a04ef1b78f16..2a71bcdba92d149ecfc8c92c2b1152bc9a8bf443 100644 (file)
@@ -293,8 +293,10 @@ static int __init dm_init_init(void)
 
        for (i = 0; i < ARRAY_SIZE(waitfor); i++) {
                if (waitfor[i]) {
+                       dev_t dev;
+
                        DMINFO("waiting for device %s ...", waitfor[i]);
-                       while (!dm_get_dev_t(waitfor[i]))
+                       while (early_lookup_bdev(waitfor[i], &dev))
                                fsleep(5000);
                }
        }