aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-03-27 04:18:09 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-27 11:45:01 -0500
commitccfcc3c10b2a5cb8fd3c918199a4ff904fc6fb3e (patch)
tree0c86fe6ba0f0bafd76f86f81b7425d6d497664aa /drivers/md/md.c
parent7ecaa1e6a1ad69862e9980b6c777e11f26c4782d (diff)
[PATCH] md: Core of raid5 resize process
This patch provides the core of the resize/expand process. sync_request notices if a 'reshape' is happening and acts accordingly. It allocated new stripe_heads for the next chunk-wide-stripe in the target geometry, marking them STRIPE_EXPANDING. Then it finds which stripe heads in the old geometry can provide data needed by these and marks them STRIPE_EXPAND_SOURCE. This causes stripe_handle to read all blocks on those stripes. Once all blocks on a STRIPE_EXPAND_SOURCE stripe_head are read, any that are needed are copied into the corresponding STRIPE_EXPANDING stripe_head. Once a STRIPE_EXPANDING stripe_head is full, it is marks STRIPE_EXPAND_READY and then is written out and released. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c7b7656f9aa5..8e65986bc63f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2165,7 +2165,9 @@ action_show(mddev_t *mddev, char *page)
2165 char *type = "idle"; 2165 char *type = "idle";
2166 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) || 2166 if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery) ||
2167 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) { 2167 test_bit(MD_RECOVERY_NEEDED, &mddev->recovery)) {
2168 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { 2168 if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
2169 type = "reshape";
2170 else if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
2169 if (!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) 2171 if (!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
2170 type = "resync"; 2172 type = "resync";
2171 else if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) 2173 else if (test_bit(MD_RECOVERY_CHECK, &mddev->recovery))
@@ -4088,8 +4090,10 @@ static void status_resync(struct seq_file *seq, mddev_t * mddev)
4088 seq_printf(seq, "] "); 4090 seq_printf(seq, "] ");
4089 } 4091 }
4090 seq_printf(seq, " %s =%3u.%u%% (%llu/%llu)", 4092 seq_printf(seq, " %s =%3u.%u%% (%llu/%llu)",
4093 (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery)?
4094 "reshape" :
4091 (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ? 4095 (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ?
4092 "resync" : "recovery"), 4096 "resync" : "recovery")),
4093 per_milli/10, per_milli % 10, 4097 per_milli/10, per_milli % 10,
4094 (unsigned long long) resync, 4098 (unsigned long long) resync,
4095 (unsigned long long) max_blocks); 4099 (unsigned long long) max_blocks);
@@ -4543,7 +4547,9 @@ static void md_do_sync(mddev_t *mddev)
4543 */ 4547 */
4544 max_sectors = mddev->resync_max_sectors; 4548 max_sectors = mddev->resync_max_sectors;
4545 mddev->resync_mismatches = 0; 4549 mddev->resync_mismatches = 0;
4546 } else 4550 } else if (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
4551 max_sectors = mddev->size << 1;
4552 else
4547 /* recovery follows the physical size of devices */ 4553 /* recovery follows the physical size of devices */
4548 max_sectors = mddev->size << 1; 4554 max_sectors = mddev->size << 1;
4549 4555
@@ -4679,6 +4685,8 @@ static void md_do_sync(mddev_t *mddev)
4679 mddev->pers->sync_request(mddev, max_sectors, &skipped, 1); 4685 mddev->pers->sync_request(mddev, max_sectors, &skipped, 1);
4680 4686
4681 if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) && 4687 if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) &&
4688 test_bit(MD_RECOVERY_SYNC, &mddev->recovery) &&
4689 !test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
4682 mddev->curr_resync > 2 && 4690 mddev->curr_resync > 2 &&
4683 mddev->curr_resync >= mddev->recovery_cp) { 4691 mddev->curr_resync >= mddev->recovery_cp) {
4684 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) { 4692 if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {