diff options
| author | Jens Axboe <axboe@kernel.dk> | 2026-05-29 20:03:47 -0600 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-06-13 06:27:24 -0600 |
| commit | 856950322678906a0947c31205dd652830f9c628 (patch) | |
| tree | ee9ee517475a6ffcd4fe81cf87a6d4d049a1788d /io_uring | |
| parent | 576cce91480a949f5b83578300f37023b933e0a2 (diff) | |
| download | linux-next-856950322678906a0947c31205dd652830f9c628.tar.gz linux-next-856950322678906a0947c31205dd652830f9c628.zip | |
io_uring/net: make POLL_FIRST receive side checks consistent
io_recv() and io_recvzc() are the odd ones out, as they checks for
whether POLL_FIRST should be honored before checking if the file is a
socket. It doesn't really matter, but might as well make it consistent
across all receive and send types.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
| -rw-r--r-- | io_uring/net.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index 5ae538b3c0f3..7deb62e3b4c0 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -1216,14 +1216,14 @@ int io_recv(struct io_kiocb *req, unsigned int issue_flags) bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK; bool mshot_finished; - if (!(req->flags & REQ_F_POLLED) && - (sr->flags & IORING_RECVSEND_POLL_FIRST)) - return -EAGAIN; - sock = sock_from_file(req->file); if (unlikely(!sock)) return -ENOTSOCK; + if (!(req->flags & REQ_F_POLLED) && + (sr->flags & IORING_RECVSEND_POLL_FIRST)) + return -EAGAIN; + flags = sr->msg_flags; if (force_nonblock) flags |= MSG_DONTWAIT; @@ -1328,14 +1328,14 @@ int io_recvzc(struct io_kiocb *req, unsigned int issue_flags) unsigned int len; int ret; - if (!(req->flags & REQ_F_POLLED) && - (zc->flags & IORING_RECVSEND_POLL_FIRST)) - return -EAGAIN; - sock = sock_from_file(req->file); if (unlikely(!sock)) return -ENOTSOCK; + if (!(req->flags & REQ_F_POLLED) && + (zc->flags & IORING_RECVSEND_POLL_FIRST)) + return -EAGAIN; + len = zc->len; ret = io_zcrx_recv(req, zc->ifq, sock, 0, issue_flags, &zc->len); if (len && zc->len == 0) { |
