block: provide bio_clear_hipri() helper
authorJens Axboe <axboe@kernel.dk>
Thu, 12 Aug 2021 17:42:53 +0000 (11:42 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Aug 2021 17:42:53 +0000 (11:42 -0600)
commit6e2e645a2467fe43bb76a2cb6f5702f39b9e6334
tree9ba55936815dbc74f13e0cc3131baab03d84f33e
parent7f07c4f1eee2c850a29f2d8a44528865b4fd86fe
block: provide bio_clear_hipri() helper

Any case that turns off REQ_HIPRI must also clear BIO_PERCPU_CACHE,
as non-polled IO may complete through hard/soft IRQ and hence isn't
safe for our polled bio alloc cache.

Provide a helper that does just that, and use it in the merging code as
well if we split a bio and turn off polling.

Fixes: cd36a5ff3ca8 ("block: clear BIO_PERCPU_CACHE flag if polling isn't supported")
Reported-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/blk-merge.c
block/blk.h