diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-10-21 12:16:41 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-10-22 16:43:03 +0200 |
commit | cc767e7c6913f770741d9fad1efa4957c2623744 (patch) | |
tree | bc25e7e05dfb6da9bdb09a9b1b3481eb9de59b57 /io_uring | |
parent | io_uring/net: fail zc send when unsupported by socket (diff) | |
download | linux-cc767e7c6913f770741d9fad1efa4957c2623744.tar.xz linux-cc767e7c6913f770741d9fad1efa4957c2623744.zip |
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 <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/0854e7bb4c3d810a48ec8b5853e2f61af36a0467.1666346426.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/net.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index 26ff3675214d..15dea91625e2 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -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; |