xen-blkfront: set blk_queue_max_hw_sectors correctly
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 21 Jun 2013 10:56:54 +0000 (12:56 +0200)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 21 Jun 2013 19:58:55 +0000 (15:58 -0400)
Now that indirect segments are enabled blk_queue_max_hw_sectors must
be set to match the maximum number of sectors we can handle in a
request.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reported-by: Felipe Franciosi <felipe.franciosi@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkfront.c

index 1a0f67c10ec7285f53ccc9afcbd5cbdfb99ac555..2e1ee348ffe1bb60b59c887dd6c2c8367bf6e6fb 100644 (file)
@@ -633,7 +633,7 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size,
        /* Hard sector size and max sectors impersonate the equiv. hardware. */
        blk_queue_logical_block_size(rq, sector_size);
        blk_queue_physical_block_size(rq, physical_sector_size);
-       blk_queue_max_hw_sectors(rq, 512);
+       blk_queue_max_hw_sectors(rq, (segments * PAGE_SIZE) / 512);
 
        /* Each segment in a request is up to an aligned page in size. */
        blk_queue_segment_boundary(rq, PAGE_SIZE - 1);