]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdopen: call "modprobe md_mod" if it might be needed.
authorNeilBrown <neilb@suse.com>
Mon, 25 Sep 2017 05:52:19 +0000 (15:52 +1000)
committerJes Sorensen <jsorensen@fb.com>
Wed, 27 Sep 2017 21:30:27 +0000 (17:30 -0400)
commitfdbf7aaa19564520055971724b70ae1652e35788
tree579faf06095085057ee4c7c1a2ed5244552d09bd
parentf12b31813ef914cddcf36b6867d05759fb37ef10
mdopen: call "modprobe md_mod" if it might be needed.

Creating an array by opening a block-device with major number of 9
will transparently load the md module if needed.
Creating an array by opening
   /sys/module/md_mod/parameters/new_array
and writing to it won't, it will just fail if md_mod isn't loaded.

So when opening that file fails with ENOENT, run "modprobe md_mod" and
try again.

This fixes a bug whereby if you have "CREATE names=yes" in mdadm.conf,
and the md modules isn't loaded, then creating or assembling an
array will not honor the "names=yes" configuration.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
mdopen.c