πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21974

Re: [PATCH net-next 06/15] batman-adv: tt: refresh local entry in single flags_lock section

#21974
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 17:20
72 lines
10856 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message of "batman-adv: tt: refresh local entry in
  single flags_lock section" tells reviewers and backporters less than…

--

batman-adv: tt: refresh local entry in single flags_lock section

This commit merges batadv_tt_local_add_existing() and
batadv_tt_local_update_flags() into batadv_tt_local_refresh(). Clearing
PENDING/ROAM, updating the dynamic flags and queueing the ADD event now all
happen in one flags_lock section. A new announce parameter requests the
initial ADD for a new entry.

Closes: https://sashiko.dev/#/bug/linux-7602d89e-b2cd-43ca-8aca-c165e5d674b2

> This is a preparation for the validation of the entry under the hash bucket
> list_lock, which then only needs to cover a single region.
>
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Closes: https://sashiko.dev/#/bug/linux-7602d89e-b2cd-43ca-8aca-c165e5d674b2

[Severity: Low]
The Reported-by: and Closes: tags suggest this is a bug fix. The message
calls it a preparation patch, though, and there is no Fixes: tag. Could the
message describe the race being fixed and what users see as a result?

Before this patch, batadv_tt_local_add() cleared PENDING in the flags_lock
section of batadv_tt_local_add_existing(). It then queued the ADD with
batadv_tt_local_event(), which reads the flags again after the lock has
been dropped:

    flags = batadv_tt_flags_get(common) | event_flags;
    __batadv_tt_local_event(bat_priv, common, flags);

That leaves a window like this:

CPU1                                   CPU2
batadv_tt_local_add()
  batadv_tt_local_add_existing()
    clear BATADV_TT_CLIENT_PENDING
                                       batadv_tt_local_remove()
                                         batadv_tt_local_set_pending()
                                           set PENDING, queue DEL
  batadv_tt_local_event()
    __batadv_tt_local_event()
      entry->change.flags = flags;

The late ADD is merged into the queued DEL, and its flags replace the DEL's
flags. The local entry still has PENDING set, so it is purged at the next
commit. The mesh is told ADD while the local table drops the client. The
CRC then no longer matches and a full table resync follows.

batadv_tt_local_refresh() now queues the event under the same flags_lock
that modifies the flags, which closes this window.

Could the commit message state this consequence and add a Fixes: tag? The
flag-update helpers being replaced seem to come from ec6edeb755ece6 and
d72e16b1c5d527.

Is this patch enough on its own to resolve the Closes: report? Or is the
later "batman-adv: tt: don't queue local events for unhashed entries" patch
also needed? Saying so in the message would help with backporting.

-- 
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123171827.3294525-2-sw%40simonwunderlich.de
Technical Details
Message-ID: <179554084001.3135.10319614345027013330@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370609-linux-kernel-netdev=dewy.ru
References: <20261123171827.3294525-7-sw@simonwunderlich.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370609-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 06/15] batman-adv: tt: refresh local entry in
 single flags_lock section
Date: Tue, 24 Nov 2026 17:20:40 +0000
Organization: Usenet Network
Message-ID: <179554084001.3135.10319614345027013330@kernel.org>
References: <20261123171827.3294525-7-sw@simonwunderlich.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4188688"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:QQIP3afbfp49eKBMhY51c6pLAiY= sha256:SuQMBLQLM33seYBa8LM3SG3O40bo5Bl0xA8qAt4rn2A=
	sha1:t4lhpfh9ZHnrYmYHfPEjhAYcHB4= sha256:JlogpzHnGsNEPA4nIDsSSZfvL/T8qFLhRO/jYP5mhKo=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 53284125E2E; Tue, 24 Nov 2026 20:21:06 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id IZOeH9FWPMSI;
	Tue, 24 Nov 2026 20:21:02 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-370609-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 06436125E2A; Tue, 24 Nov 2026 20:20:51 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 9703132553; Tue, 24 Nov 2026 17:20:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795540842;
	b=b+Ph4rGXR1U5YMKj+/I4KeUdQi5HnIC1mIKa3/AME9+Q1czUJAk6rG4KpaEg6bubIN9p
	 /cPZY81mPeefrU9SqICAcLElXb2h13vGcig0UI81wO2IMhgylP3sSBfsO9h7TR9JmZWf0
	 QebxrVelE1Wo63TDnezrcbJe1/ttiu433USqNVqTOLbGZ7/+jEvIjhxRHE22tApWtVafE
	 XldoaJ70O2DQMk9rWmS7zFB/p1vuAsNX6/ctvR5wl2/5QCHuqqAwctPWCNJtLorpdJsT9
	 x6AyvVeoPI050aCJNEXeOBmGFVjefplyNTZ37XPGOZ84C0vHAnRH1GjuEIibITsDipw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795540842;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=/OQQQduCopXVIDGmi2trA2UVwG7vGp1csUVpwdmh0dg=;
	b=E0aTvWO3zPw/bGV3Cv0Oeucloofm81V8kqgukq2ysZPFnCkuZJas34T7Vte7hRDtuBpL
	 ba4fQ9BIkJwgBpEJ/G7GmoYYRmxdigMhcu7kr4xMJ/roDTuMwh8CESlUQI1q0xz20R6hM
	 ophWtMb5g9Ja8eHHCgM/uOETSrhlh7aXAdq65awWy0IuzaMKvE2d7ZR2LcmV7R3fyKcaw
	 0q/1oPyCUA3SuVqn8C6QkM6TeEMmvyfBYuy+kn4MbTUODEszxQ3w6R48JZHFwfr+SFdIi
	 6XD4fiRagmd0Sni1EXydOuhV6Oo6i8c9mLBbZH/QgbMXFe5q0SMw93gM0b8GAKJW3QA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Hgx4/M8s";
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id DF954606A333;
	Tue, 24 Nov 2026 17:20:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Hgx4/M8s
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795540841;
	b=s6Nwebtmi6rk5ZlGalBlmImnVQlMtsmUIh3Sv4mAV6scX8oL/X7Rk530PPK9iVLhQi21
	 dysUQXwCEDF3peIeUkgmJLnmoygcr9AuXEpdF5BM0FPMqrzXONQP/oxKkWdcqmLX5bDo1
	 U1ShW/bJ9IjbEqOq9SZCUcTBZ9q+sJ7GFlqQ1XOF5HuzPXII+cwCBBWbvbJE9E980LF8A
	 09/P5YfNE29+igVILnTbvHKSb20iguNyWHtovsrEy9JNIHsRmtx68myPRtMiBBqR+Zdhr
	 qBrdc7II4YQm4CQibUqBo+nVmj9VvkBctl8LH8uUL+Z0rSpPi+3jgCa1G4VlQ6S9qqA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795540841;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=/OQQQduCopXVIDGmi2trA2UVwG7vGp1csUVpwdmh0dg=;
	b=PJ+3t9EOXsSoJHfsbbzWITJZGxNS3DMpgu+H7FE1Dg1CSPLqUGFYfxNVe0vtFKy0otsn
	 EWlapEb3F1xXecY1MAlGYNnd3OMslHu7VD5pjnz1xEhEODxpyyauTvbe7zTY81nrRxAXl
	 5owKHpFpj4YSDBAvyZCzYMmkCeTUPKVSL8+s3UKsFm/+k8gh5Gku11SVlr7oE+h+chT2G
	 zwpULqXG2NzhN9t5nf90zZLPGwBcar9IJJbuRTiX43NHcytMH84JcUVlWn64f9/MJbyLB
	 VmTQPmFyFQm28o9HYW04tlfl6N98PxtvwbyxcpOAIA9iq1P+rp0YIZI/T54flzKuNCA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="Hgx4/M8s";
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E8FB606A684
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 17:20:41 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B2061F000F0;
	Tue, 24 Nov 2026 17:20:40 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795540840;
	bh=/OQQQduCopXVIDGmi2trA2UVwG7vGp1csUVpwdmh0dg=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Hgx4/M8svojd2sq/v2XH0KHRjBIJSp2H+4xtuTcejvr0YEpkwEJcd78+ATG+mxO+Y
	 7zL4HvoLUhLaUk70StCPiDjS52phYH1qrnwm2Jf+eznWyiRo/bG1eucEgjPRYS2FQe
	 4u1vEln9AysRORseuiFWk1Woxjn2d8LeRF6IQPev5dIaFu4TbGxE0ZFLJdIyGZGwjc
	 CFLdFt+/sjCXdB5lQMRtyxfyrrvJ2nkXruSFyVdr87hzE0OypBaI4nC/DK2bcOucKB
	 AXFdyslsO8kRDMgFFyeLJX4FppIB/Cr7d/BvNYUoEIgA+lIUmIeWiGGy7Q1SzZEDYm
	 YgqrrOPkPBiJw==
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
 b.a.t.m.a.n@lists.open-mesh.org, sven@narfation.org
X-In-Reply-To: <20261123171827.3294525-7-sw@simonwunderlich.de>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list