]> 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)
commitdc72ae5e97ac34eb86ee423ca6f552b6aea25689
treec42ad53c60d1696372582e41fd7354d867ff4188
parent6dd0603e08e7906848824b6e35470027e9ab9808
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