aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-11-05 22:59:27 -0500
committerNeilBrown <neilb@suse.de>2009-11-05 22:59:27 -0500
commit24395a85d8efe6eee477ea35c73d045a8dd7a3a1 (patch)
treeeeb32daee4f1d44eaae636cfd19cc2c8e8af686a /drivers/md
parentb6727b12dd2ffb4a890eb5b13a298230c29ba45d (diff)
md: don't clear endpoint for resync when resync is interrupted.
If a 'sync_max' has been set (via sysfs), it is wrong to clear it until a resync (or reshape or recovery ...) actually reached that point. So if a resync is interrupted (e.g. by device failure), leave 'resync_max' unchanged. This is particularly important for 'reshape' operations that do not change the size of the array. For such operations mdadm needs to monitor the reshape taking rolling backups of the section being reshaped. If resync_max gets cleared, the reshape can get ahead of mdadm and then the backups that mdadm creates are useless. This is suitable for 2.6.31.y stable kernels. Cc: stable@kernel.org Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 10eb1fce975e..e64c971038d1 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6504,8 +6504,9 @@ void md_do_sync(mddev_t *mddev)
6504 skip: 6504 skip:
6505 mddev->curr_resync = 0; 6505 mddev->curr_resync = 0;
6506 mddev->curr_resync_completed = 0; 6506 mddev->curr_resync_completed = 0;
6507 mddev->resync_min = 0; 6507 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery))
6508 mddev->resync_max = MaxSector; 6508 /* We completed so max setting can be forgotten. */
6509 mddev->resync_max = MaxSector;
6509 sysfs_notify(&mddev->kobj, NULL, "sync_completed"); 6510 sysfs_notify(&mddev->kobj, NULL, "sync_completed");
6510 wake_up(&resync_wait); 6511 wake_up(&resync_wait);
6511 set_bit(MD_RECOVERY_DONE, &mddev->recovery); 6512 set_bit(MD_RECOVERY_DONE, &mddev->recovery);