Re: [PATCH mptcp-net v2 2/3] mptcp: use READ/WRITE_ONCE for allow_subflows

Matthieu Baerts <[email protected]>
Newsgroups dev.linux.lists.mptcp
Organization NGI0 Core
Message-ID <[email protected]>
Hi Chenguang,

On 15/07/2026 08:18, Chenguang Zhao wrote:
> From: Chenguang Zhao <[email protected]>
> 
> mptcp_is_fully_established() may read allow_subflows without holding
> fallback_lock. Annotate all allow_subflows accesses with READ_ONCE and
> WRITE_ONCE to avoid data-race warnings and make the concurrency model
> explicit.

Is it not enough to use READ_ONCE only with mptcp_is_fully_established?

The others read this variable with fallback_lock. WRITE_ONCE is still
needed.

Or maybe mptcp_is_fully_established should check allow_subflows while
holding fallback_lock? (I didn't check what's best, but I don't think
this helper is used in fast paths)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.