summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-08-31 11:20:02 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-12 13:40:22 +0200
commit732fd460bb72fd51607311009b7d474a6e0e47f3 (patch)
treec110d67f44550b80adcb2893b6e5a71c0d61c1da /block
parent9244e838ac0d3d98887d44ea68bedf08a94ebabf (diff)
downloadlinux-stable-732fd460bb72fd51607311009b7d474a6e0e47f3.tar.gz
linux-stable-732fd460bb72fd51607311009b7d474a6e0e47f3.tar.bz2
linux-stable-732fd460bb72fd51607311009b7d474a6e0e47f3.zip
block: ensure bdi->io_pages is always initialized
[ Upstream commit de1b0ee490eafdf65fac9eef9925391a8369f2dc ] If a driver leaves the limit settings as the defaults, then we don't initialize bdi->io_pages. This means that file systems may need to work around bdi->io_pages == 0, which is somewhat messy. Initialize the default value just like we do for ->ra_pages. Cc: stable@vger.kernel.org Fixes: 9491ae4aade6 ("mm: don't cap request size based on read-ahead setting") Reported-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index ea33d6abdcfc..ce3710404544 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1036,6 +1036,8 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id,
q->backing_dev_info->ra_pages =
(VM_MAX_READAHEAD * 1024) / PAGE_SIZE;
+ q->backing_dev_info->io_pages =
+ (VM_MAX_READAHEAD * 1024) / PAGE_SIZE;
q->backing_dev_info->capabilities = BDI_CAP_CGROUP_WRITEBACK;
q->backing_dev_info->name = "block";
q->node = node_id;