diff options
author | NeilBrown <neilb@suse.de> | 2009-05-25 22:57:21 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-05-25 22:57:21 -0400 |
commit | 7a91ee1f628ef6bfe3f13067c0ddf9db520cb86b (patch) | |
tree | b6b317a2dfb067784fccae113001cb3957e25337 /drivers/md | |
parent | 848b3182365fdf5a05bcd5ed949071cac2c894b3 (diff) |
md: don't update curr_resync_completed without also updating reshape_position.
In order for the metadata to always be consistent, we mustn't updated
curr_resync_completed without also updating reshape_position.
The reshape code updates both at the same time. However since
commit 97e4f42d62badb0f9fbc27c013e89bc1336a03bc
the common md_do_sync will sometimes update curr_resync_completed
but is not in a position to update reshape_position.
So if MD_RECOVERY_RESHAPE is set (indicating that a reshape is
happening, so reshape_position might change), don't update
curr_resync_completed in md_do_sync, leave it to the per-personality
reshape code.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/md.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 384e4f0904c8..954456532acc 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -6362,12 +6362,13 @@ void md_do_sync(mddev_t *mddev) | |||
6362 | 6362 | ||
6363 | skipped = 0; | 6363 | skipped = 0; |
6364 | 6364 | ||
6365 | if ((mddev->curr_resync > mddev->curr_resync_completed && | 6365 | if (!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && |
6366 | (mddev->curr_resync - mddev->curr_resync_completed) | 6366 | ((mddev->curr_resync > mddev->curr_resync_completed && |
6367 | > (max_sectors >> 4)) || | 6367 | (mddev->curr_resync - mddev->curr_resync_completed) |
6368 | (j - mddev->curr_resync_completed)*2 | 6368 | > (max_sectors >> 4)) || |
6369 | >= mddev->resync_max - mddev->curr_resync_completed | 6369 | (j - mddev->curr_resync_completed)*2 |
6370 | ) { | 6370 | >= mddev->resync_max - mddev->curr_resync_completed |
6371 | )) { | ||
6371 | /* time to update curr_resync_completed */ | 6372 | /* time to update curr_resync_completed */ |
6372 | blk_unplug(mddev->queue); | 6373 | blk_unplug(mddev->queue); |
6373 | wait_event(mddev->recovery_wait, | 6374 | wait_event(mddev->recovery_wait, |