OSDN Git Service

io_uring: don't attempt re-add of multishot poll request if racing
authorJens Axboe <axboe@kernel.dk>
Tue, 6 Apr 2021 15:49:31 +0000 (09:49 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Apr 2021 01:30:35 +0000 (19:30 -0600)
commitcb3b200e4f66524d03d6410dd51bcf42f265a4d0
treed05a2a97170a702d71d888fe929acef1567e59d6
parent417b5052be9ec892d06a45dbecf6d3f6ae211ae3
io_uring: don't attempt re-add of multishot poll request if racing

We currently allow racy updates to multishot requests, but we can end up
double adding the poll request if both completion and update does it.
Ensure that we skip re-add on the update side if someone else is
completing it.

Fixes: b69de288e913 ("io_uring: allow events and user_data update of running poll requests")
Reported-by: Joakim Hassila <joj@mac.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c