diff options
author | NeilBrown <neilb@suse.de> | 2011-12-06 22:39:39 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-12-06 22:39:39 +0100 |
commit | 1c278e81813fc481114413f730ad348319382ffe (patch) | |
tree | d9617b5fdcd2facf2a848dfd65be6be05eaa6a0d /monitor.c | |
parent | FIX: resolve make everything compilation error (diff) | |
download | mdadm-1c278e81813fc481114413f730ad348319382ffe.tar.xz mdadm-1c278e81813fc481114413f730ad348319382ffe.zip |
monitor: don't unblock a device that isn't blocked.
When we see a failed device, we both unblock and remove it (after
updating the metadata).
However it might not be blocked as there can be a delay between
unblocking and the device being free to be removed.
If this happens the clearing of 'blocked' succeeds so md sends a sysfs
notification and mdmon checks again and tries to clear 'blocked'
again.
Thus it enters a busy-loop until the 'remove' succeeds.
To avoid this, only try to unblock if the device was blocked.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -339,7 +339,8 @@ static int read_and_act(struct active_array *a) a->container->ss->set_disk(a, mdi->disk.raid_disk, mdi->curr_state); check_degraded = 1; - mdi->next_state |= DS_UNBLOCK; + if (mdi->curr_state & DS_BLOCKED) + mdi->next_state |= DS_UNBLOCK; if (a->curr_state == read_auto) { a->container->ss->set_array_state(a, 0); a->next_state = active; |