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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 051ecfa61514..779958705abf 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1726,7 +1726,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
1726 return 0; 1726 return 0;
1727 } 1727 }
1728 1728
1729 max_sector = mddev->size << 1; 1729 max_sector = mddev->dev_sectors;
1730 if (sector_nr >= max_sector) { 1730 if (sector_nr >= max_sector) {
1731 /* If we aborted, we need to abort the 1731 /* If we aborted, we need to abort the
1732 * sync on the 'current' bitmap chunk (there will 1732 * sync on the 'current' bitmap chunk (there will
@@ -2051,7 +2051,7 @@ static int run(mddev_t *mddev)
2051 /* 2051 /*
2052 * Ok, everything is just fine now 2052 * Ok, everything is just fine now
2053 */ 2053 */
2054 mddev->array_sectors = mddev->size * 2; 2054 mddev->array_sectors = mddev->dev_sectors;
2055 2055
2056 mddev->queue->unplug_fn = raid1_unplug; 2056 mddev->queue->unplug_fn = raid1_unplug;
2057 mddev->queue->backing_dev_info.congested_fn = raid1_congested; 2057 mddev->queue->backing_dev_info.congested_fn = raid1_congested;
@@ -2116,12 +2116,12 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
2116 mddev->array_sectors = sectors; 2116 mddev->array_sectors = sectors;
2117 set_capacity(mddev->gendisk, mddev->array_sectors); 2117 set_capacity(mddev->gendisk, mddev->array_sectors);
2118 mddev->changed = 1; 2118 mddev->changed = 1;
2119 if (mddev->array_sectors / 2 > mddev->size && 2119 if (mddev->array_sectors > mddev->dev_sectors &&
2120 mddev->recovery_cp == MaxSector) { 2120 mddev->recovery_cp == MaxSector) {
2121 mddev->recovery_cp = mddev->size << 1; 2121 mddev->recovery_cp = mddev->dev_sectors;
2122 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 2122 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
2123 } 2123 }
2124 mddev->size = mddev->array_sectors / 2; 2124 mddev->dev_sectors = mddev->array_sectors;
2125 mddev->resync_max_sectors = sectors; 2125 mddev->resync_max_sectors = sectors;
2126 return 0; 2126 return 0;
2127} 2127}