From 4b5c7ae83704320e2afb0912f4c42eadabc7535b Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 27 Jul 2005 11:43:28 -0700 Subject: [PATCH] md: when resizing an array, we need to update resync_max_sectors as well as size Without this, and attempt to 'grow' an array will claim to have synced the extra part without actually having done anything. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/raid6main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/md/raid6main.c') diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index f62ea1a..f5ee168 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c @@ -2095,6 +2095,7 @@ static int raid6_resize(mddev_t *mddev, sector_t sectors) set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); } mddev->size = sectors /2; + mddev->resync_max_sectors = sectors; return 0; } -- cgit v1.1 From b1581566183f310abbd2d384a9079d4039faca05 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sun, 31 Jul 2005 22:34:50 -0700 Subject: [PATCH] md: make sure raid5/raid6 resync uses correct 'max_sectors' The default resync_max_sector is set to "mddev->size << 1". If the raid-personality-module updates mddev->size, it must update resync_max_sectors too. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/raid6main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/md/raid6main.c') diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index f5ee168..495dee1 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c @@ -1813,6 +1813,7 @@ static int run (mddev_t *mddev) /* device size must be a multiple of chunk size */ mddev->size &= ~(mddev->chunk_size/1024 -1); + mddev->resync_max_sectors = mddev->size << 1; if (conf->raid_disks < 4) { printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n", -- cgit v1.1