Revision 74f464e97044da33b25aaed00213914b0edf1f2e authored by Jens Axboe on 17 April 2019, 14:57:48 UTC, committed by Jens Axboe on 17 April 2019, 17:41:49 UTC
This is a leftover from when the rings initially were not free flowing,
and hence a test for tail + 1 == head would indicate full. Since we now
let them wrap instead of mask them with the size, we need to check if
they drift more than the ring size from each other.

This fixes a case where we'd overwrite CQ ring entries, if the user
failed to reap completions. Both cases would ultimately result in lost
completions as the application violated the depth it asked for. The only
difference is that before this fix we'd return invalid entries for the
overflowed completions, instead of properly flagging it in the
cq_ring->overflow variable.

Reported-by: Stefan Bühler <source@stbuehler.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b19062a
History
File Mode Size
Kconfig -rw-r--r-- 4.3 KB
Makefile -rw-r--r-- 307 bytes
ftrace.c -rw-r--r-- 3.6 KB
inode.c -rw-r--r-- 10.3 KB
internal.h -rw-r--r-- 1.2 KB
platform.c -rw-r--r-- 18.9 KB
pmsg.c -rw-r--r-- 2.3 KB
ram.c -rw-r--r-- 24.2 KB
ram_core.c -rw-r--r-- 15.1 KB

back to top