diff options
author | NeilBrown <neilb@suse.de> | 2015-06-12 12:05:04 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-06-12 12:16:33 +0200 |
commit | ea358cd0d2c634ff1379a1392edcdf2289f31e13 (patch) | |
tree | 10c556b9ae108c35af563df9041e3d1948295e66 /drivers/md/raid5.c | |
parent | md: Close race when setting 'action' to 'idle'. (diff) | |
download | linux-ea358cd0d2c634ff1379a1392edcdf2289f31e13.tar.xz linux-ea358cd0d2c634ff1379a1392edcdf2289f31e13.zip |
md: make sure MD_RECOVERY_DONE is clear before starting recovery/resync
MD_RECOVERY_DONE is normally cleared by md_check_recovery after a
resync etc finished. However it is possible for raid5_start_reshape
to race and start a reshape before MD_RECOVERY_DONE is cleared. This
can lean to multiple reshapes running at the same time, which isn't
good.
To make sure it is cleared before starting a reshape, and also clear
it when reaping a thread, just to be safe.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-rw-r--r-- | drivers/md/raid5.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 553d54b87052..b6793d2e051f 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -7354,6 +7354,7 @@ static int raid5_start_reshape(struct mddev *mddev) clear_bit(MD_RECOVERY_SYNC, &mddev->recovery); clear_bit(MD_RECOVERY_CHECK, &mddev->recovery); + clear_bit(MD_RECOVERY_DONE, &mddev->recovery); set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery); set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); mddev->sync_thread = md_register_thread(md_do_sync, mddev, |