__io_uring_get_cqe: fix spurious -EAGAIN
__io_uring_get_cqe: fix spurious -EAGAIN

A previous patch always cleared the number to wait for once we'd done
on io_uring_enter(), but we need to be sure that we've actually waited
for the right amount before doing so. Check this by matching the
return value with what we asked to submit - if it matches, we know we
can safely clear 'wait_nr'.

We also need to ensure that the original wait_nr is retained for the
peek test.

Fixes: 8a031500a304 ("__io_uring_get_cqe: eliminate unnecessary io_uring_enter() syscalls")
Signed-off-by: Jens Axboe <cd8c6775e60d6f67a6984377324e5290df3d5358@kernel.dk>

axboe/liburing,axboe/liburing,axboe/liburing