aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 491dc2d4ad5f..03a5ab705c20 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2043,7 +2043,7 @@ static int run(mddev_t *mddev)
2043 /* 2043 /*
2044 * Ok, everything is just fine now 2044 * Ok, everything is just fine now
2045 */ 2045 */
2046 mddev->array_size = mddev->size; 2046 mddev->array_sectors = mddev->size * 2;
2047 2047
2048 mddev->queue->unplug_fn = raid1_unplug; 2048 mddev->queue->unplug_fn = raid1_unplug;
2049 mddev->queue->backing_dev_info.congested_fn = raid1_congested; 2049 mddev->queue->backing_dev_info.congested_fn = raid1_congested;
@@ -2105,14 +2105,15 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
2105 * any io in the removed space completes, but it hardly seems 2105 * any io in the removed space completes, but it hardly seems
2106 * worth it. 2106 * worth it.
2107 */ 2107 */
2108 mddev->array_size = sectors>>1; 2108 mddev->array_sectors = sectors;
2109 set_capacity(mddev->gendisk, mddev->array_size << 1); 2109 set_capacity(mddev->gendisk, mddev->array_sectors);
2110 mddev->changed = 1; 2110 mddev->changed = 1;
2111 if (mddev->array_size > mddev->size && mddev->recovery_cp == MaxSector) { 2111 if (mddev->array_sectors / 2 > mddev->size &&
2112 mddev->recovery_cp == MaxSector) {
2112 mddev->recovery_cp = mddev->size << 1; 2113 mddev->recovery_cp = mddev->size << 1;
2113 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 2114 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
2114 } 2115 }
2115 mddev->size = mddev->array_size; 2116 mddev->size = mddev->array_sectors / 2;
2116 mddev->resync_max_sectors = sectors; 2117 mddev->resync_max_sectors = sectors;
2117 return 0; 2118 return 0;
2118} 2119}