block: allow end_io based requests in the completion batch handling

With end_io handlers now being able to potentially pass ownership of
the request upon completion, we can allow requests with end_io handlers
in the batch completion handling.

Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Co-developed-by: Stefan Roesch <shr@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe 2022-09-21 08:24:16 -06:00
parent de671d6116
commit ab3e1d3bba
2 changed files with 13 additions and 3 deletions

View file

@ -853,8 +853,9 @@ static inline bool blk_mq_add_to_batch(struct request *req,
struct io_comp_batch *iob, int ioerror,
void (*complete)(struct io_comp_batch *))
{
if (!iob || (req->rq_flags & RQF_ELV) || req->end_io || ioerror)
if (!iob || (req->rq_flags & RQF_ELV) || ioerror)
return false;
if (!iob->complete)
iob->complete = complete;
else if (iob->complete != complete)