summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDwight Engen <dwight.engen@oracle.com>2014-09-19 09:42:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-21 09:23:00 -0800
commit42f107f9c7644f201f0d2d56ae106814f51ed3bf (patch)
tree759f8a00592f21fb98bac233c54311f7eccda517 /drivers
parentb3c23e4a27492ae9321c6a719b9b3b6d7090d416 (diff)
sunvdc: limit each sg segment to a page
[ Upstream commit 5eed69ffd248c9f68f56c710caf07db134aef28b ] ldc_map_sg() could fail its check that the number of pages referred to by the sg scatterlist was <= the number of cookies. This fixes the issue by doing a similar thing to the xen-blkfront driver, ensuring that the scatterlist will only ever contain a segment count <= port->ring_cookies, and each segment will be page aligned, and <= page size. This ensures that the scatterlist is always mappable. Orabug: 19347817 OraBZ: 15945 Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/sunvdc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index 1616ad091a5e..1a9360da1f54 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -747,6 +747,10 @@ static int probe_disk(struct vdc_port *port)
port->disk = g;
+ /* Each segment in a request is up to an aligned page in size. */
+ blk_queue_segment_boundary(q, PAGE_SIZE - 1);
+ blk_queue_max_segment_size(q, PAGE_SIZE);
+
blk_queue_max_segments(q, port->ring_cookies);
blk_queue_max_hw_sectors(q, port->max_xfer_size);
g->major = vdc_major;