From: Al Viro <viro@zeniv.linux.org.uk>
To: netdev@vger.kernel.org
Cc: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: [Q] why do we ever try to call unix_dgram_peer_wake_disconnect() for SOCK_STREAM?
Date: Sun, 24 Feb 2019 06:28:12 +0000 [thread overview]
Message-ID: <20190224062803.GG2217@ZenIV.linux.org.uk> (raw)
What's the point of calling unix_dgram_peer_wake_disconnect() in
unix_release_sock() of SOCK_STREAM/SOCK_SEQPACKET sockets? AFAICS,
for those we never call unix_dgram_peer_wake_connect(), i.e. ->peer_wake.private
of any non-SOCK_DGRAM socker has to remain NULL. Which makes that call simply
spin_lock(&unix_sk(skpair)->peer_wait.lock);
spin_unlock(&unix_sk(skpair)->peer_wait.lock);
and that doesn't even serve as a barrier for anything else. Should that
have been
if (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) {
unix_state_lock(skpair);
/* No more writes */
skpair->sk_shutdown = SHUTDOWN_MASK;
if (!skb_queue_empty(&sk->sk_receive_queue) || embrion)
skpair->sk_err = ECONNRESET;
unix_state_unlock(skpair);
skpair->sk_state_change(skpair);
sk_wake_async(skpair, SOCK_WAKE_WAITD, POLL_HUP);
} else {
unix_dgram_peer_wake_disconnect(sk, skpair);
}
or am I missing something subtle here?
reply other threads:[~2019-02-24 6:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190224062803.GG2217@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=rweikusat@mobileactivedefense.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).