Skip to content

Commit 8569503

Browse files
committed
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>
1 parent 576cce9 commit 8569503

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

io_uring/net.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,14 +1216,14 @@ int io_recv(struct io_kiocb *req, unsigned int issue_flags)
12161216
bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;
12171217
bool mshot_finished;
12181218

1219-
if (!(req->flags & REQ_F_POLLED) &&
1220-
(sr->flags & IORING_RECVSEND_POLL_FIRST))
1221-
return -EAGAIN;
1222-
12231219
sock = sock_from_file(req->file);
12241220
if (unlikely(!sock))
12251221
return -ENOTSOCK;
12261222

1223+
if (!(req->flags & REQ_F_POLLED) &&
1224+
(sr->flags & IORING_RECVSEND_POLL_FIRST))
1225+
return -EAGAIN;
1226+
12271227
flags = sr->msg_flags;
12281228
if (force_nonblock)
12291229
flags |= MSG_DONTWAIT;
@@ -1328,14 +1328,14 @@ int io_recvzc(struct io_kiocb *req, unsigned int issue_flags)
13281328
unsigned int len;
13291329
int ret;
13301330

1331-
if (!(req->flags & REQ_F_POLLED) &&
1332-
(zc->flags & IORING_RECVSEND_POLL_FIRST))
1333-
return -EAGAIN;
1334-
13351331
sock = sock_from_file(req->file);
13361332
if (unlikely(!sock))
13371333
return -ENOTSOCK;
13381334

1335+
if (!(req->flags & REQ_F_POLLED) &&
1336+
(zc->flags & IORING_RECVSEND_POLL_FIRST))
1337+
return -EAGAIN;
1338+
13391339
len = zc->len;
13401340
ret = io_zcrx_recv(req, zc->ifq, sock, 0, issue_flags, &zc->len);
13411341
if (len && zc->len == 0) {

0 commit comments

Comments
 (0)