On 9/24/26 12:06, Stefano Garzarella wrote:
> On Tue, Sep 22, 2026 at 03:17:30PM +0200, Michal Luczaj wrote:
>> On 9/16/26 14:30, Stefano Garzarella wrote:
>>> On Tue, Sep 15, 2026 at 03:15:13PM +0200, Michal Luczaj wrote:
>>>> Follow vhost's vhost_vsock_reset_orphans() and VMCI's
>>>> vmci_transport_handle_detach(): set SHUTDOWN_MASK, which will come handy
>>>> later in the series.
>>>
>>> IMO it would be better to include the reason here as well. Every commit
>>> should explain why doing a change.
>>
>> Sure, will do.
>>
>>>> static void virtio_vsock_reset_sock(struct sock *sk)
>>>> {
>>>> + struct vsock_sock *vsk = vsock_sk(sk);
>>>> +
>>>> /* vmci_transport.c doesn't take sk_lock here either. At least we're
>>>> * under vsock_table_lock so the sock cannot disappear while we're
>>>> * executing.
>>>> */
>>>>
>>>> + vsk->peer_shutdown = SHUTDOWN_MASK;
>>>
>>> In all other places we use WRITE_ONCE/READ_ONCE on vsk->peer_shutdown,
>>> should we do the same here?
>>
>> Right, we should. Isn't this also the case for sk_state and sk_err?
>
> Are those read without the sk_lock?
net/vmw_vsock/diag.c's sk_diag_fill()/vsock_diag_dump() do read sk_state
without the sk_lock. As for sk_err: vsock_poll(). That said, I agree only
WRITE_ONCE(peer_shutdown) would makes sense here. But we're not doing it in
v3 anyway, so no problem.