aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/linear.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/linear.c')
-rw-r--r--drivers/md/linear.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index af2d39d603c7..09437e958235 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -19,6 +19,7 @@
19#include <linux/blkdev.h> 19#include <linux/blkdev.h>
20#include <linux/raid/md_u.h> 20#include <linux/raid/md_u.h>
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/slab.h>
22#include "md.h" 23#include "md.h"
23#include "linear.h" 24#include "linear.h"
24 25
@@ -172,12 +173,14 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks)
172 disk_stack_limits(mddev->gendisk, rdev->bdev, 173 disk_stack_limits(mddev->gendisk, rdev->bdev,
173 rdev->data_offset << 9); 174 rdev->data_offset << 9);
174 /* as we don't honour merge_bvec_fn, we must never risk 175 /* as we don't honour merge_bvec_fn, we must never risk
175 * violating it, so limit ->max_sector to one PAGE, as 176 * violating it, so limit max_segments to 1 lying within
176 * a one page request is never in violation. 177 * a single page.
177 */ 178 */
178 if (rdev->bdev->bd_disk->queue->merge_bvec_fn && 179 if (rdev->bdev->bd_disk->queue->merge_bvec_fn) {
179 queue_max_sectors(mddev->queue) > (PAGE_SIZE>>9)) 180 blk_queue_max_segments(mddev->queue, 1);
180 blk_queue_max_hw_sectors(mddev->queue, PAGE_SIZE>>9); 181 blk_queue_segment_boundary(mddev->queue,
182 PAGE_CACHE_SIZE - 1);
183 }
181 184
182 conf->array_sectors += rdev->sectors; 185 conf->array_sectors += rdev->sectors;
183 cnt++; 186 cnt++;