block: ensure bdi->io_pages is always initialized
authorJens Axboe <axboe@kernel.dk>
Mon, 31 Aug 2020 17:20:02 +0000 (11:20 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:29 +0000 (19:14 +0200)
commita7a42c1e5023cdac2bbc1038689509595d279cd2
treebe9ca5bae2e7af7f5c4fc504093005592af24e35
parentb7df98a8b7b8abce596e9696d5c3183fc4c0019d
block: ensure bdi->io_pages is always initialized

commit de1b0ee490eafdf65fac9eef9925391a8369f2dc upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-core.c