aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 58f3927fd7cc..0fee0e54d36f 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1607,9 +1607,9 @@ static int dm_merge_bvec(struct request_queue *q,
1607 * Find maximum amount of I/O that won't need splitting 1607 * Find maximum amount of I/O that won't need splitting
1608 */ 1608 */
1609 max_sectors = min(max_io_len(bvm->bi_sector, ti), 1609 max_sectors = min(max_io_len(bvm->bi_sector, ti),
1610 (sector_t) BIO_MAX_SECTORS); 1610 (sector_t) queue_max_sectors(q));
1611 max_size = (max_sectors << SECTOR_SHIFT) - bvm->bi_size; 1611 max_size = (max_sectors << SECTOR_SHIFT) - bvm->bi_size;
1612 if (max_size < 0) 1612 if (unlikely(max_size < 0)) /* this shouldn't _ever_ happen */
1613 max_size = 0; 1613 max_size = 0;
1614 1614
1615 /* 1615 /*
@@ -1621,10 +1621,10 @@ static int dm_merge_bvec(struct request_queue *q,
1621 max_size = ti->type->merge(ti, bvm, biovec, max_size); 1621 max_size = ti->type->merge(ti, bvm, biovec, max_size);
1622 /* 1622 /*
1623 * If the target doesn't support merge method and some of the devices 1623 * If the target doesn't support merge method and some of the devices
1624 * provided their merge_bvec method (we know this by looking at 1624 * provided their merge_bvec method (we know this by looking for the
1625 * queue_max_hw_sectors), then we can't allow bios with multiple vector 1625 * max_hw_sectors that dm_set_device_limits may set), then we can't
1626 * entries. So always set max_size to 0, and the code below allows 1626 * allow bios with multiple vector entries. So always set max_size
1627 * just one page. 1627 * to 0, and the code below allows just one page.
1628 */ 1628 */
1629 else if (queue_max_hw_sectors(q) <= PAGE_SIZE >> 9) 1629 else if (queue_max_hw_sectors(q) <= PAGE_SIZE >> 9)
1630 max_size = 0; 1630 max_size = 0;