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:
|
case OffRootOpt:
|
||||||
argv[0][0] = '@';
|
argv[0][0] = '@';
|
||||||
|
__offroot = 1;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case ':':
|
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_DELAYED -2
|
||||||
#define PROCESS_PENDING -3
|
#define PROCESS_PENDING -3
|
||||||
|
|
||||||
|
extern int __offroot;
|
||||||
|
|
17
util.c
17
util.c
|
@ -32,6 +32,8 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
|
int __offroot;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* following taken from linux/blkpg.h because they aren't
|
* following taken from linux/blkpg.h because they aren't
|
||||||
* anywhere else and it isn't safe to #include linux/ * stuff.
|
* anywhere else and it isn't safe to #include linux/ * stuff.
|
||||||
|
@ -1622,10 +1624,17 @@ int start_mdmon(int devnum)
|
||||||
skipped = 0;
|
skipped = 0;
|
||||||
|
|
||||||
for (i=0; paths[i]; i++)
|
for (i=0; paths[i]; i++)
|
||||||
if (paths[i][0])
|
if (paths[i][0]) {
|
||||||
execl(paths[i], "mdmon",
|
if (__offroot) {
|
||||||
devnum2devname(devnum),
|
execl(paths[i], "mdmon", "--offroot",
|
||||||
NULL);
|
devnum2devname(devnum),
|
||||||
|
NULL);
|
||||||
|
} else {
|
||||||
|
execl(paths[i], "mdmon",
|
||||||
|
devnum2devname(devnum),
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
exit(1);
|
exit(1);
|
||||||
case -1: fprintf(stderr, Name ": cannot run mdmon. "
|
case -1: fprintf(stderr, Name ": cannot run mdmon. "
|
||||||
"Array remains readonly\n");
|
"Array remains readonly\n");
|
||||||
|
|
Loading…
Reference in New Issue