diff options
author | NeilBrown <neilb@suse.de> | 2023-03-14 01:06:25 +0100 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-03-19 17:35:40 +0100 |
commit | 2e10c46d0906b1a1ec40e8f5005ccb63125dcd9e (patch) | |
tree | 5a26789e3280e852fb9bec96f2fcc41f3960e960 /mdopen.c | |
parent | mdmon: Improve switchroot interactions. (diff) | |
download | mdadm-2e10c46d0906b1a1ec40e8f5005ccb63125dcd9e.tar.xz mdadm-2e10c46d0906b1a1ec40e8f5005ccb63125dcd9e.zip |
mdopen: always try create_named_array()
mdopen() will use create_named_array() to ask the kernel to create the
given md array, but only if it is given a number or name.
If it is NOT given a name and is required to choose one itself using
find_free_devnm() it does NOT use create_named_array().
On kernels with CONFIG_BLOCK_LEGACY_AUTOLOAD not set, this can result in
failure to assemble an array. This can particularly seen when the
"name" of the array begins with a host name different to the name of the
host running the command.
So add the missing call to create_named_array().
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217074
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'mdopen.c')
-rw-r--r-- | mdopen.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -370,6 +370,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy, } if (block_udev) udev_block(devnm); + create_named_array(devnm); } sprintf(devname, "/dev/%s", devnm); |