Skip to content

Commit cc767e7

Browse files
isilenceaxboe
authored andcommitted
io_uring/net: fail zc sendmsg when unsupported by socket
The previous patch fails zerocopy send requests for protocols that don't support it, do the same for zerocopy sendmsg. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/0854e7bb4c3d810a48ec8b5853e2f61af36a0467.1666346426.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent edf8143 commit cc767e7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

io_uring/net.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,8 @@ int io_sendmsg_zc(struct io_kiocb *req, unsigned int issue_flags)
11531153
sock = sock_from_file(req->file);
11541154
if (unlikely(!sock))
11551155
return -ENOTSOCK;
1156+
if (!test_bit(SOCK_SUPPORT_ZC, &sock->flags))
1157+
return -EOPNOTSUPP;
11561158

11571159
if (req_has_async_data(req)) {
11581160
kmsg = req->async_data;

0 commit comments

Comments
 (0)