Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/net: clusterise send vs msghdr branches

We have multiple branches at prep for send vs sendmsg handling, put them
together so that the variant handling is more localised.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/33abf666d9ded74cba4da2f0d9fe58e88520dffe.1743202294.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
49dbce56 63b16e4f

+4 -11
+4 -11
io_uring/net.c
··· 395 395 396 396 sr->done_io = 0; 397 397 sr->retry = false; 398 - 399 - if (req->opcode != IORING_OP_SEND) { 400 - if (sqe->addr2 || sqe->file_index) 401 - return -EINVAL; 402 - } 403 - 404 398 sr->len = READ_ONCE(sqe->len); 405 399 sr->flags = READ_ONCE(sqe->ioprio); 406 400 if (sr->flags & ~SENDMSG_FLAGS) ··· 420 426 return -ENOMEM; 421 427 if (req->opcode != IORING_OP_SENDMSG) 422 428 return io_send_setup(req, sqe); 429 + if (unlikely(sqe->addr2 || sqe->file_index)) 430 + return -EINVAL; 423 431 return io_sendmsg_setup(req, sqe); 424 432 } 425 433 ··· 1299 1303 } 1300 1304 } 1301 1305 1302 - if (req->opcode != IORING_OP_SEND_ZC) { 1303 - if (unlikely(sqe->addr2 || sqe->file_index)) 1304 - return -EINVAL; 1305 - } 1306 - 1307 1306 zc->len = READ_ONCE(sqe->len); 1308 1307 zc->msg_flags = READ_ONCE(sqe->msg_flags) | MSG_NOSIGNAL | MSG_ZEROCOPY; 1309 1308 req->buf_index = READ_ONCE(sqe->buf_index); ··· 1314 1323 req->flags |= REQ_F_IMPORT_BUFFER; 1315 1324 return io_send_setup(req, sqe); 1316 1325 } 1326 + if (unlikely(sqe->addr2 || sqe->file_index)) 1327 + return -EINVAL; 1317 1328 ret = io_sendmsg_setup(req, sqe); 1318 1329 if (unlikely(ret)) 1319 1330 return ret;