Commit abdad70
committed
io_uring: recycle provided before arming poll
We currently have a race where we recycle the selected buffer if poll
returns IO_APOLL_OK. But that's too late, as the poll could already be
triggering or have triggered. If that race happens, then we're putting a
buffer that's already being used.
Fix this by recycling before we arm poll. This does mean that we'll
sometimes almost instantly re-select the buffer, but it's rare enough in
testing that it should not pose a performance issue.
Fixes: b1c6264 ("io_uring: recycle provided buffers if request goes async")
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 5e92936 commit abdad70
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6240 | 6240 | | |
6241 | 6241 | | |
6242 | 6242 | | |
| 6243 | + | |
| 6244 | + | |
6243 | 6245 | | |
6244 | 6246 | | |
6245 | 6247 | | |
| |||
7491 | 7493 | | |
7492 | 7494 | | |
7493 | 7495 | | |
7494 | | - | |
7495 | 7496 | | |
7496 | 7497 | | |
7497 | 7498 | | |
| |||
0 commit comments