diff options
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 5a06122abd3b..f741f77eeb2b 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1152,13 +1152,17 @@ static int raid1_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1152 | 1152 | ||
1153 | disk_stack_limits(mddev->gendisk, rdev->bdev, | 1153 | disk_stack_limits(mddev->gendisk, rdev->bdev, |
1154 | rdev->data_offset << 9); | 1154 | rdev->data_offset << 9); |
1155 | /* as we don't honour merge_bvec_fn, we must never risk | 1155 | /* as we don't honour merge_bvec_fn, we must |
1156 | * violating it, so limit ->max_sector to one PAGE, as | 1156 | * never risk violating it, so limit |
1157 | * a one page request is never in violation. | 1157 | * ->max_segments to one lying with a single |
1158 | * page, as a one page request is never in | ||
1159 | * violation. | ||
1158 | */ | 1160 | */ |
1159 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 1161 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn) { |
1160 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) | 1162 | blk_queue_max_segments(mddev->queue, 1); |
1161 | blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9); | 1163 | blk_queue_segment_boundary(mddev->queue, |
1164 | PAGE_CACHE_SIZE - 1); | ||
1165 | } | ||
1162 | 1166 | ||
1163 | p->head_position = 0; | 1167 | p->head_position = 0; |
1164 | rdev->raid_disk = mirror; | 1168 | rdev->raid_disk = mirror; |
@@ -2098,12 +2102,14 @@ static int run(mddev_t *mddev) | |||
2098 | disk_stack_limits(mddev->gendisk, rdev->bdev, | 2102 | disk_stack_limits(mddev->gendisk, rdev->bdev, |
2099 | rdev->data_offset << 9); | 2103 | rdev->data_offset << 9); |
2100 | /* as we don't honour merge_bvec_fn, we must never risk | 2104 | /* as we don't honour merge_bvec_fn, we must never risk |
2101 | * violating it, so limit ->max_sector to one PAGE, as | 2105 | * violating it, so limit ->max_segments to 1 lying within |
2102 | * a one page request is never in violation. | 2106 | * a single page, as a one page request is never in violation. |
2103 | */ | 2107 | */ |
2104 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 2108 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn) { |
2105 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) | 2109 | blk_queue_max_segments(mddev->queue, 1); |
2106 | blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9); | 2110 | blk_queue_segment_boundary(mddev->queue, |
2111 | PAGE_CACHE_SIZE - 1); | ||
2112 | } | ||
2107 | } | 2113 | } |
2108 | 2114 | ||
2109 | mddev->degraded = 0; | 2115 | mddev->degraded = 0; |