Skip to content

Commit

Permalink
dm: do not allow readahead to limit IO size
Browse files Browse the repository at this point in the history
Update DM to set the bdi's io_pages.  This fixes reads to be capped at
the device's max request size (even if user's read IO exceeds the
established readahead setting).

Fixes: 9491ae4 ("mm: don't cap request size based on read-ahead setting")
Cc: [email protected]
Reviewed-by: Jens Axboe <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
  • Loading branch information
Jaegeuk Kim authored and snitm committed Dec 18, 2018
1 parent 74694bc commit c6d6e9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/* Allow reads to exceed readahead limits */
q->backing_dev_info->io_pages = limits->max_sectors >> (PAGE_SHIFT - 9);
}

unsigned int dm_table_get_num_targets(struct dm_table *t)
Expand Down

0 comments on commit c6d6e9b

Please sign in to comment.