]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fri, 28 Feb 2020 14:51:48 +0000 (17:51 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 5 May 2020 10:32:22 +0000 (12:32 +0200)
commit612d1884175b944efa2cd6cd79cf8b4228054546
tree7e5c40ad59b128e1e2946c6bec3cbe928109ef37
parent2146d25f40131dc882d5a7373c160d7a45f19744
block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices

BugLink: https://bugs.launchpad.net/bugs/1873481
[ Upstream commit e74d93e96d721c4297f2a900ad0191890d2fc2b0 ]

Field bdi->io_pages added in commit 9491ae4aade6 ("mm: don't cap request
size based on read-ahead setting") removes unneeded split of read requests.

Stacked drivers do not call blk_queue_max_hw_sectors(). Instead they set
limits of their devices by blk_set_stacking_limits() + disk_stack_limits().
Field bio->io_pages stays zero until user set max_sectors_kb via sysfs.

This patch updates io_pages after merging limits in disk_stack_limits().

Commit c6d6e9b0f6b4 ("dm: do not allow readahead to limit IO size") fixed
the same problem for device-mapper devices, this one fixes MD RAIDs.

Fixes: 9491ae4aade6 ("mm: don't cap request size based on read-ahead setting")
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
block/blk-settings.c