linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md: do not write resync checkpoint, if max_sector has been reached.
@ 2011-01-27 16:50 Przemyslaw Czarnowski
  2011-01-31  2:45 ` NeilBrown
  0 siblings, 1 reply; 5+ messages in thread
From: Przemyslaw Czarnowski @ 2011-01-27 16:50 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, wojciech.neubauer, dan.j.williams, ed.ciechanowski

If disk fails during resync, sync service of personality usually skips the
rest of not synchronized stripes. It finishes sync thread (md_do_sync())
and wakes up the main raid thread. md_recovery_check() starts and
unregisteres sync thread.
In the meanwhile mdmon also services failed disk - removes and replaces it
with a new one (if it was available).
If checkpoint is stored (with value of array's max_sector), next
md_recovery_check() will restart resync. It finishes normally and
activates ALL spares (including the one added recently) what is wrong.
Another md_recovery_check() will not start recovery as all disks are in
sync. If checkpoint is not stored, second resync does not start and
recovery can proceed.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
---
 drivers/md/md.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 3e40aad..6eda858 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6929,7 +6929,8 @@ void md_do_sync(mddev_t *mddev)
 	if (!test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
 	    mddev->curr_resync > 2) {
 		if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
-			if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
+			if (test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
+			    mddev->curr_resync < max_sectors) {
 				if (mddev->curr_resync >= mddev->recovery_cp) {
 					printk(KERN_INFO
 					       "md: checkpointing %s of %s.\n",


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-01 23:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-27 16:50 [PATCH] md: do not write resync checkpoint, if max_sector has been reached Przemyslaw Czarnowski
2011-01-31  2:45 ` NeilBrown
2011-01-31 18:48   ` Hawrylewicz Czarnowski, Przemyslaw
2011-02-01  1:07     ` NeilBrown
2011-02-01 23:45       ` Hawrylewicz Czarnowski, Przemyslaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).