RE: [PATCH net] tipc: restore write readiness when a socket's group goes away
From: Tung Quang Nguyen
Date: Sun Nov 22 2026 - 23:03:04 EST
>Subject: [PATCH net] tipc: restore write readiness when a socket's group goes
>away
>
>From: Suyuan Wang <stevewong@xxxxxxxxxxx>
>
>tipc_group_create() sets tsk->group_is_open to false, and tipc_poll() only
>reports EPOLLOUT for a socket in TIPC_OPEN state when that flag is true.
>Commit 1b22bcad7e39 ("tipc: correct initial value for group congestion flag")
>made sure the flag is true for sockets that never join a group, since otherwise
>"SOCK_RDM/DGRAM sockets sending datagrams never receive POLLOUT".
>
>The flag is not set back when the group goes away again, though:
>
>- tipc_group_create() clears the flag and then fails when the topology
> subscription cannot be created, for example when TIPC_MAX_SUBSCR
> subscriptions exist already;
>- tipc_sk_join() deletes the new group when tipc_sk_publish() fails,
> for example when the node's publication limit is reached;
>- tipc_sk_leave() deletes the group while the flag may still be false,
> e.g. because of group congestion, or because the group has no other
> members yet.
>
>In all three cases the socket is back to an ordinary RDM/DGRAM socket, but
>poll() never reports EPOLLOUT for it again. Before commit
>60c253069632 ("tipc: fix race between poll() and setsockopt()"),
>tipc_poll() also reported EPOLLOUT when tsk->group was NULL, so deleting the
>group was enough; since then the flag has to be reset.
>
>Set tsk->group_is_open to true in these three places, as it is for a socket that
>never had a group, and call sk_write_space() so that a task already waiting for
>EPOLLOUT is woken up, as tipc_sk_filter_rcv() does when a group becomes
>open again.
>
Reviewed-by: Tung Nguyen <tung.quang.nguyen@xxxxxxxx>