]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't recycle provided buffer if punted to async worker
authorJens Axboe <axboe@kernel.dk>
Tue, 22 Mar 2022 20:12:33 +0000 (14:12 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 Mar 2022 12:26:06 +0000 (06:26 -0600)
commit15f220694cd1b0e6a25aa73e7c4341a0f974ed3a
tree708d8aab0fded171847c4c9a15689e25d42ab145
parent40133bf3b9a7b7cf95146045b098eb9210a0b629
io_uring: don't recycle provided buffer if punted to async worker

We only really need to recycle the buffer when going async for a file
type that has an indefinite reponse time (eg non-file/bdev). And for
files that to arm poll, the async worker will arm poll anyway and the
buffer will get recycled there.

In that latter case, we're not holding ctx->uring_lock. Ensure we take
the issue_flags into account and acquire it if we need to.

Fixes: c213365915ab ("io_uring: recycle provided buffers if request goes async")
Reported-by: Stefan Roesch <shr@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c