summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2015-07-06 12:26:57 +1000
committerNeilBrown <neilb@suse.com>2015-08-31 19:30:40 +0200
commit985ca973b68cac0adfa83497db231da7f99c6ed9 (patch)
tree816918bd82c720959d6d7728376436709f65c16d /drivers/md/raid1.c
parentf7851be736d58e7270f05a4ca84b16ce72734a18 (diff)
downloadop-kernel-dev-985ca973b68cac0adfa83497db231da7f99c6ed9.zip
op-kernel-dev-985ca973b68cac0adfa83497db231da7f99c6ed9.tar.gz
md: close some races between setting and checking sync_action.
When checking sync_action in a script, we want to be sure it is as accurate as possible. As resync/reshape etc doesn't always start immediately (a separate thread is scheduled to do it), it is best if 'action_show' checks if MD_RECOVER_NEEDED is set (which it does) and in that case reports what is likely to start soon (which it only sometimes does). So: - report 'reshape' if reshape_position suggests one might start. - set MD_RECOVERY_RECOVER in raid1_reshape(), because that is very likely to happen next. Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 967a4ed..742b507 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -3113,6 +3113,7 @@ static int raid1_reshape(struct mddev *mddev)
unfreeze_array(conf);
+ set_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
md_wakeup_thread(mddev->thread);
OpenPOWER on IntegriCloud