Skip to content

Commit cc9c6e1

Browse files
koct9igregkh
authored andcommitted
block: keep bdi->io_pages in sync with max_sectors_kb for stacked devices
[ Upstream commit e74d93e ] Field bdi->io_pages added in commit 9491ae4 ("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 c6d6e9b ("dm: do not allow readahead to limit IO size") fixed the same problem for device-mapper devices, this one fixes MD RAIDs. Fixes: 9491ae4 ("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>
1 parent 6e0de5f commit cc9c6e1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎block/blk-settings.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,9 @@ void disk_stack_limits(struct gendisk *disk, struct block_device *bdev,
664664
printk(KERN_NOTICE "%s: Warning: Device %s is misaligned\n",
665665
top, bottom);
666666
}
667+
668+
t->backing_dev_info->io_pages =
669+
t->limits.max_sectors >> (PAGE_SHIFT - 9);
667670
}
668671
EXPORT_SYMBOL(disk_stack_limits);
669672

0 commit comments

Comments
 (0)