Skip to content
Commit 2c7f0232 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring/net: only consider msg_inq if larger than 1



Currently retry and general validity of msg_inq is gated on it being
larger than zero, but it's entirely possible for this to be slightly
inaccurate. In particular, if FIN is received, it'll return 1.

Just use larger than 1 as the check. This covers both the FIN case, and
at the same time, it doesn't make much sense to retry a recv immediately
if there's even just a single 1 byte of valid data in the socket.

Leave the SOCK_NONEMPTY flagging when larger than 0 still, as an app may
use that for the final receive.

Cc: stable@vger.kernel.org
Reported-by: default avatarChristian Mazakas <christian.mazakas@gmail.com>
Fixes: 7c71a0af ("io_uring/net: improve recv bundles")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 0ec33c81
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment