Thread (25 messages) 25 messages, 4 authors, 4d ago

Re: [PATCH net-next 2/9] net: add sk_set_nospace() and sk_clear_nospace()

From: Kuniyuki Iwashima <kuniyu@google.com>
Date: 2026-09-23 21:54:28

On Tue, Sep 22, 2026 at 5:27 AM Eric Dumazet [off-list ref] wrote:
SOCK_NOSPACE lives in sk->sk_socket->flags and is manipulated from
about thirty places in the tree, all of them open coding the
sk->sk_socket dereference, some with a NULL check, some without,
and some reaching the struct socket by yet another path.

Add sk_set_nospace() and sk_clear_nospace() helpers and convert all
the setters and clearers to them, so that "git grep _bit(SOCK_NOSPACE"
only reports the two helpers and the remaining test_bit() sites.

Callers that had no NULL check are all called from user context with a
socket attached, so folding the check into the helpers only makes them
more robust.

No functional change intended.

This is a preparation patch: a following one gives TCP a cheaper
private copy of this bit, and needs a single choke point to keep it
in sync.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help