Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 403c37ff authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Alistair Strachan
Browse files

UPSTREAM: dm: do not allow readahead to limit IO size



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: 9491ae4a ("mm: don't cap request size based on read-ahead setting")
Cc: stable@vger.kernel.org
Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
(cherry picked from commit c6d6e9b0f6b4201c77f2cea3964dd122697e3543)
Bug: 120757803
Link: https://patchwork.kernel.org/patch/10746255/
Change-Id: I876f4c5425253c2a0876d5ef7fefe36c4edcb46c
parent c29a889a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1937,6 +1937,9 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
	 */
	if (blk_queue_add_random(q) && dm_table_all_devices_attribute(t, device_is_not_random))
		blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);

	/* 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)