diff options
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 7584f9ab9bcf..b4ba41ecbd20 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1155,13 +1155,17 @@ static int raid10_add_disk(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1155 | 1155 | ||
1156 | disk_stack_limits(mddev->gendisk, rdev->bdev, | 1156 | disk_stack_limits(mddev->gendisk, rdev->bdev, |
1157 | rdev->data_offset << 9); | 1157 | rdev->data_offset << 9); |
1158 | /* as we don't honour merge_bvec_fn, we must never risk | 1158 | /* as we don't honour merge_bvec_fn, we must |
1159 | * violating it, so limit ->max_sector to one PAGE, as | 1159 | * never risk violating it, so limit |
1160 | * a one page request is never in violation. | 1160 | * ->max_segments to one lying with a single |
1161 | * page, as a one page request is never in | ||
1162 | * violation. | ||
1161 | */ | 1163 | */ |
1162 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 1164 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn) { |
1163 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) | 1165 | blk_queue_max_segments(mddev->queue, 1); |
1164 | blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9); | 1166 | blk_queue_segment_boundary(mddev->queue, |
1167 | PAGE_CACHE_SIZE - 1); | ||
1168 | } | ||
1165 | 1169 | ||
1166 | p->head_position = 0; | 1170 | p->head_position = 0; |
1167 | rdev->raid_disk = mirror; | 1171 | rdev->raid_disk = mirror; |
@@ -2255,12 +2259,14 @@ static int run(mddev_t *mddev) | |||
2255 | disk_stack_limits(mddev->gendisk, rdev->bdev, | 2259 | disk_stack_limits(mddev->gendisk, rdev->bdev, |
2256 | rdev->data_offset << 9); | 2260 | rdev->data_offset << 9); |
2257 | /* as we don't honour merge_bvec_fn, we must never risk | 2261 | /* as we don't honour merge_bvec_fn, we must never risk |
2258 | * violating it, so limit ->max_sector to one PAGE, as | 2262 | * violating it, so limit max_segments to 1 lying |
2259 | * a one page request is never in violation. | 2263 | * within a single page. |
2260 | */ | 2264 | */ |
2261 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn && | 2265 | if (rdev->bdev->bd_disk->queue->merge_bvec_fn) { |
2262 | queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) | 2266 | blk_queue_max_segments(mddev->queue, 1); |
2263 | blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9); | 2267 | blk_queue_segment_boundary(mddev->queue, |
2268 | PAGE_CACHE_SIZE - 1); | ||
2269 | } | ||
2264 | 2270 | ||
2265 | disk->head_position = 0; | 2271 | disk->head_position = 0; |
2266 | } | 2272 | } |