This patch makes dm be aware of io_pages to assign sane req_size for reads.

Cc: [email protected]
Cc: Jens Axboe <[email protected]>
Cc: Alasdair Kergon <[email protected]>
Cc: Mike Snitzer <[email protected]>
Cc: [email protected]
Fixes: 9491ae4a ("mm: don't cap request size based on read-ahead setting")
Signed-off-by: Jaegeuk Kim <[email protected]>
---
 drivers/md/dm-table.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 9038c302d5c2..886790428241 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1927,6 +1927,9 @@ void dm_table_set_restrictions(struct dm_table *t, struct 
request_queue *q,
         */
        if (blk_queue_is_zoned(q))
                blk_revalidate_disk_zones(t->md->disk);
+
+       /* io_pages is used for readahead */
+       q->backing_dev_info->io_pages = limits->max_sectors >> (PAGE_SHIFT - 9);
 }
 
 unsigned int dm_table_get_num_targets(struct dm_table *t)
-- 
2.19.0.605.g01d371f741-goog

Reply via email to