summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorAnna Czarnowska <anna.czarnowska@intel.com>2010-11-22 20:58:06 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 20:58:06 +1100
commitedde9560fa19af53928059784c81a0cf5badefa2 (patch)
tree45876ccbf0fcbd2d51e8324b276481d08f91f758 /mdadm.c
parent0eac199a2ce5d7febc071616450c26882779ed09 (diff)
mdadm: added --no-sharing option for Monitor mode
--no-sharing option disables moving spares between arrays/containers. Without the option spares are moved if needed according to config rules. We only allow one process moving spares started with --scan option. If there is such process running and another instance of Monitor is starting without --scan, then we issue a warning but allow it to continue. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mdadm.c b/mdadm.c
index 0eef6bc8..07460c6a 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -96,6 +96,7 @@ int main(int argc, char *argv[])
int daemonise = 0;
char *pidfile = NULL;
int oneshot = 0;
+ int spare_sharing = 1;
struct supertype *ss = NULL;
int writemostly = 0;
int re_add = 0;
@@ -228,6 +229,7 @@ int main(int argc, char *argv[])
subarray = optarg;
}
case 'K': if (!mode) newmode = MISC; break;
+ case NoSharing: newmode = MONITOR; break;
}
if (mode && newmode == mode) {
/* everybody happy ! */
@@ -777,7 +779,9 @@ int main(int argc, char *argv[])
openlog("mdadm", LOG_PID, SYSLOG_FACILITY);
dosyslog = 1;
continue;
-
+ case O(MONITOR, NoSharing):
+ spare_sharing = 0;
+ continue;
/* now the general management options. Some are applicable
* to other modes. None have arguments.
*/
@@ -1494,7 +1498,7 @@ int main(int argc, char *argv[])
}
rv= Monitor(devlist, mailaddr, program,
delay?delay:60, daemonise, scan, oneshot,
- dosyslog, test, pidfile, increments);
+ dosyslog, test, pidfile, increments, spare_sharing);
break;
case GROW: