提交 10cd84c2 编写于 作者: S Stefan Metzmacher 提交者: Zheng Zengkai

io_uring: imply MSG_NOSIGNAL for send[msg]()/recv[msg]() calls

stable inclusion
from stable-5.10.28
commit 21c2bbc17b6bb6cb221547c1947fbf190e342424
bugzilla: 51779

--------------------------------

[ Upstream commit 76cd979f ]

We never want to generate any SIGPIPE, -EPIPE only is much better.
Signed-off-by: NStefan Metzmacher <metze@samba.org>
Link: https://lore.kernel.org/r/38961085c3ec49fd21550c7788f214d1ff02d2d4.1615908477.git.metze@samba.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e9fafa27
...@@ -4415,7 +4415,7 @@ static int io_sendmsg(struct io_kiocb *req, bool force_nonblock, ...@@ -4415,7 +4415,7 @@ static int io_sendmsg(struct io_kiocb *req, bool force_nonblock,
kmsg = &iomsg; kmsg = &iomsg;
} }
flags = req->sr_msg.msg_flags; flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
if (flags & MSG_DONTWAIT) if (flags & MSG_DONTWAIT)
req->flags |= REQ_F_NOWAIT; req->flags |= REQ_F_NOWAIT;
else if (force_nonblock) else if (force_nonblock)
...@@ -4459,7 +4459,7 @@ static int io_send(struct io_kiocb *req, bool force_nonblock, ...@@ -4459,7 +4459,7 @@ static int io_send(struct io_kiocb *req, bool force_nonblock,
msg.msg_controllen = 0; msg.msg_controllen = 0;
msg.msg_namelen = 0; msg.msg_namelen = 0;
flags = req->sr_msg.msg_flags; flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
if (flags & MSG_DONTWAIT) if (flags & MSG_DONTWAIT)
req->flags |= REQ_F_NOWAIT; req->flags |= REQ_F_NOWAIT;
else if (force_nonblock) else if (force_nonblock)
...@@ -4653,7 +4653,7 @@ static int io_recvmsg(struct io_kiocb *req, bool force_nonblock, ...@@ -4653,7 +4653,7 @@ static int io_recvmsg(struct io_kiocb *req, bool force_nonblock,
1, req->sr_msg.len); 1, req->sr_msg.len);
} }
flags = req->sr_msg.msg_flags; flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
if (flags & MSG_DONTWAIT) if (flags & MSG_DONTWAIT)
req->flags |= REQ_F_NOWAIT; req->flags |= REQ_F_NOWAIT;
else if (force_nonblock) else if (force_nonblock)
...@@ -4711,7 +4711,7 @@ static int io_recv(struct io_kiocb *req, bool force_nonblock, ...@@ -4711,7 +4711,7 @@ static int io_recv(struct io_kiocb *req, bool force_nonblock,
msg.msg_iocb = NULL; msg.msg_iocb = NULL;
msg.msg_flags = 0; msg.msg_flags = 0;
flags = req->sr_msg.msg_flags; flags = req->sr_msg.msg_flags | MSG_NOSIGNAL;
if (flags & MSG_DONTWAIT) if (flags & MSG_DONTWAIT)
req->flags |= REQ_F_NOWAIT; req->flags |= REQ_F_NOWAIT;
else if (force_nonblock) else if (force_nonblock)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册