linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 8 of 8] MD:  raid5 do not set fullsync
@ 2011-06-07 22:52 Jonathan Brassow
  2011-06-08  5:20 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Brassow @ 2011-06-07 22:52 UTC (permalink / raw)
  To: linux-raid

Add new flag for struct mdk_rdev_s to indicate when recovery can use bitmap

Device-mapper can tell if a device is in-sync, in need of partial (bitmap aided)
recovery, or in need of complete recovery.  The raid5 code assumes that if a
device is not in-sync, then it must undergo complete recovery - it does not
honor the bitmap.  The flag 'RecoverByBitmap' has been introduced to force raid5
not to set 'conf->fullsync' if the superblock routines have already determined
that only a partial recovery is necessary.

RFC-by: Jonathan Brassow <jbrassow@redhat.com>

Index: linux-2.6/drivers/md/raid5.c
===================================================================
--- linux-2.6.orig/drivers/md/raid5.c
+++ linux-2.6/drivers/md/raid5.c
@@ -4858,7 +4858,7 @@ static raid5_conf_t *setup_conf(mddev_t 
 			printk(KERN_INFO "md/raid:%s: device %s operational as raid"
 			       " disk %d\n",
 			       mdname(mddev), bdevname(rdev->bdev, b), raid_disk);
-		} else
+		} else if (!test_bit(RecoverByBitmap, &rdev->flags))
 			/* Cannot rely on bitmap to complete recovery */
 			conf->fullsync = 1;
 	}
Index: linux-2.6/drivers/md/md.h
===================================================================
--- linux-2.6.orig/drivers/md/md.h
+++ linux-2.6/drivers/md/md.h
@@ -77,6 +77,8 @@ struct mdk_rdev_s
 #define Blocked		8		/* An error occurred on an externally
 					 * managed array, don't allow writes
 					 * until it is cleared */
+#define RecoverByBitmap 9               /* Used by device-mapper to ensure this
+					 * device is recovered by the bitmap. */
 	wait_queue_head_t blocked_wait;
 
 	int desc_nr;			/* descriptor index in the superblock */



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

end of thread, other threads:[~2011-06-08  5:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-07 22:52 [PATCH 8 of 8] MD: raid5 do not set fullsync Jonathan Brassow
2011-06-08  5:20 ` NeilBrown

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).