Skip to content

Commit

Permalink
io_uring/net: fail zc sendmsg when unsupported by socket
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
isilence authored and axboe committed Oct 22, 2022
1 parent edf8143 commit cc767e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions io_uring/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,8 @@ int io_sendmsg_zc(struct io_kiocb *req, unsigned int issue_flags)
sock = sock_from_file(req->file);
if (unlikely(!sock))
return -ENOTSOCK;
if (!test_bit(SOCK_SUPPORT_ZC, &sock->flags))
return -EOPNOTSUPP;

if (req_has_async_data(req)) {
kmsg = req->async_data;
Expand Down

0 comments on commit cc767e7

Please sign in to comment.