diff options
author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2020-02-28 17:51:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-17 10:48:39 +0200 |
commit | fd397508347f31324a70d1f389ee4ec75e3f9dc0 (patch) | |
tree | 2d77e877665cc752cd95165c8b2f1d3ebbd86a01 /block/blk-settings.c | |
parent | 88d5a6fc582d06c59d0b3407bc721dfc1f21b6e3 (diff) | |
download | linux-stable-fd397508347f31324a70d1f389ee4ec75e3f9dc0.tar.gz linux-stable-fd397508347f31324a70d1f389ee4ec75e3f9dc0.tar.bz2 linux-stable-fd397508347f31324a70d1f389ee4ec75e3f9dc0.zip |
block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices
[ 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>
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r-- | block/blk-settings.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c index be9b39caadbd..01093b8f3e62 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -717,6 +717,9 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n", top, bottom); } + + t->backing_dev_info->io_pages = + t->limits.max_sectors >> (PAGE_SHIFT - 9); } EXPORT_SYMBOL(disk_stack_limits); |