diff options
author | Chris Webb <chris@arachsys.com> | 2022-06-01 14:03:07 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-08-03 02:14:40 +0300 |
commit | 05ce7fb946c37fc6fc8bf14073279e570f78f69e (patch) | |
tree | 268dc1f9fedfc1cfdf5d5d6239795bff20b2812d /drivers/md/md.c | |
parent | 9973f0fa7d20269fe6fefe6333997fb5914449c1 (diff) | |
download | linux-05ce7fb946c37fc6fc8bf14073279e570f78f69e.tar.xz |
md: Explicitly create command-line configured devices
Boot-time assembly of arrays with md= command-line arguments breaks when
CONFIG_BLOCK_LEGACY_AUTOLOAD is unset. md_setup_drive() in md-autodetect.c
calls blkdev_get_by_dev(), assuming this implicitly creates the block
device.
Fix this by attempting to md_alloc() the array first. As in the probe path,
ignore any error as failure is caught by blkdev_get_by_dev() anyway.
Signed-off-by: Chris Webb <chris@arachsys.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 621cf85962da..f511f183aca6 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5623,7 +5623,7 @@ int mddev_init_writes_pending(struct mddev *mddev) } EXPORT_SYMBOL_GPL(mddev_init_writes_pending); -static int md_alloc(dev_t dev, char *name) +int md_alloc(dev_t dev, char *name) { /* * If dev is zero, name is the name of a device to allocate with |