]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: only call io_cqring_ev_posted() if events were posted
authorJens Axboe <axboe@kernel.dk>
Sun, 24 Jan 2021 23:58:56 +0000 (16:58 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jan 2021 01:13:56 +0000 (18:13 -0700)
commit8a9278b99b9a60ab672307e13411c37aca54890d
treec42ad53c60d1696372582e41fd7354d867ff4188
parent60fc93b9b1a15c3deddafd9bae82b6e9cb1f4ca6
io_uring: only call io_cqring_ev_posted() if events were posted

This normally doesn't cause any extra harm, but it does mean that we'll
increment the eventfd notification count, if one has been registered
with the ring. This can confuse applications, when they see more
notifications on the eventfd side than are available in the ring.

Do the nice thing and only increment this count, if we actually posted
(or even overflowed) events.

Reported-and-tested-by: Dan Melnic <dmm@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c