summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-12-16 09:07:52 +1100
committerNeilBrown <neilb@suse.de>2010-12-16 09:07:52 +1100
commit0f99b4bd73c916004fe94d17c7f37c8c6f68c8b8 (patch)
tree72b2507aaeeebbec3069a88c1e9ce91545bdb288 /monitor.c
parentb5420ef325eb2d80da9002a5805d6161f551dc0c (diff)
downloadmdadm-0f99b4bd73c916004fe94d17c7f37c8c6f68c8b8.tar.gz
mdmon: when a reshape is detected, add any newly added devices to the array.
When mdadm starts a reshape, it might add some devices to the array first. mdmon needs to notice the reshape starting and check for any new devices. If there are any they need to be provided to be monitored. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index f166bc8..f566890 100644
--- a/monitor.c
+++ b/monitor.c
@@ -215,6 +215,7 @@ static int read_and_act(struct active_array *a)
{
unsigned long long sync_completed;
int check_degraded = 0;
+ int check_reshape = 0;
int deactivate = 0;
struct mdinfo *mdi;
int dirty = 0;
@@ -305,6 +306,15 @@ static int read_and_act(struct active_array *a)
}
}
+ if (!deactivate &&
+ a->curr_action == reshape &&
+ a->prev_action != reshape)
+ /* reshape was requested by mdadm. Need to see if
+ * new devices have been added. Manager does that
+ * when it sees check_reshape
+ */
+ check_reshape = 1;
+
/* Check for failures and if found:
* 1/ Record the failure in the metadata and unblock the device.
* FIXME update the kernel to stop notifying on failed drives when
@@ -393,9 +403,12 @@ static int read_and_act(struct active_array *a)
mdi->next_state = 0;
}
- if (check_degraded) {
+ if (check_degraded || check_reshape) {
/* manager will do the actual check */
- a->check_degraded = 1;
+ if (check_degraded)
+ a->check_degraded = 1;
+ if (check_reshape)
+ a->check_reshape = 1;
signal_manager();
}