OSDN Git Service

io_uring: don't do opcode prep twice
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 23 Jul 2020 17:25:20 +0000 (20:25 +0300)
committerJens Axboe <axboe@kernel.dk>
Fri, 24 Jul 2020 19:00:46 +0000 (13:00 -0600)
commitae34817bd93e373a03203a4c6892735c430a14e1
tree36e31c3d6eb575289ab4ad10a293c661fa3b8396
parent23b3628e45924419399da48c2b3a522b05557c91
io_uring: don't do opcode prep twice

Calling into opcode prep handlers may be dangerous, as they re-read
SQE but might not re-initialise requests completely. If io_req_defer()
passed fast checks and is done with preparations, punt it async.

As all other cases are covered with nulling @sqe, this guarantees that
io_[opcode]_prep() are visited only once per request.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c