]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix double bio queue when merging in cached request path
authorJens Axboe <axboe@kernel.dk>
Thu, 2 Dec 2021 19:43:46 +0000 (12:43 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 3 Dec 2021 02:39:01 +0000 (19:39 -0700)
commit341da3da2814e4de0b1a35da4e2d36f84005a32c
treedf0fe69900a59fa4f9e3098c19b7e82f010d3e7f
parent0daa8a602b839dbc47fbf4a529fa48fb4799fcc6
block: fix double bio queue when merging in cached request path

When we attempt to merge off the cached request path, we return NULL
if successful. This makes the caller believe that it's should allocate
a new request, and hence we end up with the bio both merged and associated
with a new request. This, predictably, leads to all sorts of crashes.

Pass in a pointer to the bio pointer, and clear it for the merge case.
Then the caller knows that the bio is already queued, and no new requests
need to get allocated.

Fixes: 3dbd9d5eb210 ("blk-mq: cleanup request allocation")
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c