Skip to content
Commit ea8f505e authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'vsock-handle-writes-to-shutdowned-socket'

Arseniy Krasnov says:

====================
vsock: handle writes to shutdowned socket

this small patchset adds POSIX compliant behaviour on writes to the
socket which was shutdowned with 'shutdown()' (both sides - local with
SHUT_WR flag, peer - with SHUT_RD flag). According POSIX we must send
SIGPIPE in such cases (but SIGPIPE is not send when MSG_NOSIGNAL is set).

First patch is implemented in the same way as net/ipv4/tcp.c:tcp_sendmsg_locked().
It uses 'sk_stream_error()' function which handles EPIPE error. Another
way is to use code from net/unix/af_unix.c:unix_stream_sendmsg() where
same logic from 'sk_stream_error()' is implemented "from scratch", but
it doesn't check 'sk_err' field. I think error from this field has more
priority to be returned from syscall. So I guess it is better to reuse
currently implemented 'sk_stream_error()' function.

Test is also added.
====================

Link: https://lore.kernel.org/r/20230911202027.1928574-1-avkrasnov@salutedevices.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents ca5ab963 b698bd97
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment