Spawn mdmon with --offroot if mdadm was launched with --offroot
Acked-by: Doug Ledford <dledford@redhat.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
da827518c1
commit
a0963a86e1
1
mdadm.c
1
mdadm.c
|
@ -181,6 +181,7 @@ int main(int argc, char *argv[])
|
|||
*/
|
||||
case OffRootOpt:
|
||||
argv[0][0] = '@';
|
||||
__offroot = 1;
|
||||
continue;
|
||||
|
||||
case ':':
|
||||
|
|
2
mdadm.h
2
mdadm.h
|
@ -1383,3 +1383,5 @@ static inline int xasprintf(char **strp, const char *fmt, ...) {
|
|||
|
||||
#define PROCESS_DELAYED -2
|
||||
#define PROCESS_PENDING -3
|
||||
|
||||
extern int __offroot;
|
||||
|
|
17
util.c
17
util.c
|
@ -32,6 +32,8 @@
|
|||
#include <dirent.h>
|
||||
#include <signal.h>
|
||||
|
||||
int __offroot;
|
||||
|
||||
/*
|
||||
* following taken from linux/blkpg.h because they aren't
|
||||
* anywhere else and it isn't safe to #include linux/ * stuff.
|
||||
|
@ -1622,10 +1624,17 @@ int start_mdmon(int devnum)
|
|||
skipped = 0;
|
||||
|
||||
for (i=0; paths[i]; i++)
|
||||
if (paths[i][0])
|
||||
execl(paths[i], "mdmon",
|
||||
devnum2devname(devnum),
|
||||
NULL);
|
||||
if (paths[i][0]) {
|
||||
if (__offroot) {
|
||||
execl(paths[i], "mdmon", "--offroot",
|
||||
devnum2devname(devnum),
|
||||
NULL);
|
||||
} else {
|
||||
execl(paths[i], "mdmon",
|
||||
devnum2devname(devnum),
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
case -1: fprintf(stderr, Name ": cannot run mdmon. "
|
||||
"Array remains readonly\n");
|
||||
|
|
Loading…
Reference in New Issue