Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP3:Update
mdadm.7129
0082-mdopen-modprobe-md_mod-if-it-might-be-need...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0082-mdopen-modprobe-md_mod-if-it-might-be-needed.patch of Package mdadm.7129
From: NeilBrown <neilb@suse.com> Date: Mon, 25 Sep 2017 12:15:45 +1000 Subject: [PATCH] mdopen: call "modprobe md_mod" if it might be needed. References: bsc#1059596 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> --- mdopen.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/mdopen.c +++ b/mdopen.c @@ -306,6 +306,10 @@ int create_mddev(char *dev, char *name, int n = -1; sprintf(devnm, "md_%s", cname); fd = open("/sys/module/md_mod/parameters/new_array", O_WRONLY); + if (fd < 0 && errno == ENOENT) { + system("modprobe md_mod"); + fd = open("/sys/module/md_mod/parameters/new_array", O_WRONLY); + } if (fd >= 0) { n = write(fd, devnm, strlen(devnm)); close(fd);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor