Re: [PATCH net] mptcp: Avoid unsequenced accesses to jiffies in mptcp_reset_tout_timer()
From: Matthieu Baerts
Date: Mon Nov 16 2026 - 09:40:23 EST
Hi Nathan,
On 15/11/2026 05:30, Nathan Chancellor wrote:
> After a recent improvement in clang to warn on unsequenced accesses to
> volatile variables [1], an instance appears in mptcp_reset_tout_timer(),
> which can break the build with CONFIG_WERROR=y / W=e:
>
> net/mptcp/protocol.c:3044:20: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced]
> 3044 | tcp_jiffies32 + jiffies + mptcp_close_timeout(sk);
> | ~~~~~~~~~~~~~ ^
>
> Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11
> 6.5.2, unsequenced side effects on the same scalar object are undefined
> behavior. Per C11 6.5.3, unless otherwise specified, side effects and
> value computations of subexpressions are unsequenced within expressions.
>
> Add an explicit sequence point by splitting the addition expression in
> half, eliminating the undefined behavior and clearing up the warning.
Thank you for the fix, it looks good to me:
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
@Net maintainers: this can be applied in net directly (simple, safe, and
avoid build break with -Werror on newer version of clang).
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.