On Tuesday, 24 November 2026 18:20:47 CET netdev-bot+sashiko@kernel.org wrote: [...] > > diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c > > index 2a7f50de70fc8..b03d6c74732f4 100644 > > --- a/net/batman-adv/translation-table.c > > +++ b/net/batman-adv/translation-table.c > > [ ... ] > > > @@ -1876,9 +1882,8 @@ batadv_tt_local_set_pending(struct batadv_priv *bat_priv, > > * > > * All checks and modifications happen under the hash bucket list_lock and the > > * flags_lock of the entry. This prevents a concurrent > > - * batadv_tt_local_purge_pending_clients() from removing the entry, > > - * batadv_tt_local_transition_new() from clearing BATADV_TT_CLIENT_NEW and > > - * batadv_tt_local_refresh() from modifying the entry after it was checked. > > + * batadv_tt_local_commit_change() from removing the entry and > > + * batadv_tt_local_refresh() from modifying it after it was checked. > > */ > > [Severity: Low] > Should batadv_tt_local_purge_pending_clients() still be listed here? Will adjust it in a follow up patch: diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index ede6c15581242dc3fe6ecdb1ba0fab3ab601faa7..22197827fa5d220850d57e6697393ac098d0cd03 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -2001,8 +2001,9 @@ batadv_tt_local_set_pending(struct batadv_priv *bat_priv, * * All checks and modifications happen under the hash bucket list_lock and the * flags_lock of the entry. This prevents a concurrent - * batadv_tt_local_commit_change() from removing the entry and - * batadv_tt_local_refresh() from modifying it after it was checked. + * batadv_tt_local_commit_change() or batadv_tt_local_purge_pending_clients() + * from removing the entry and batadv_tt_local_refresh() from modifying it after + * it was checked. */ static void batadv_tt_local_remove_entry(struct batadv_priv *bat_priv, [...] > On a related note, the comment in batadv_tt_local_unhash() is no longer > accurate: > > /* An entry which still carries BATADV_TT_CLIENT_NEW was never counted > * and must not be uncounted here. > */ > if (!(tt_common->flags & BATADV_TT_CLIENT_NEW)) > batadv_tt_local_size_dec(bat_priv, tt_common->key.vid); > > batadv_tt_local_commit_change() can now set NEW again on an entry that > was already counted, and it uncounts that entry with > batadv_tt_local_size_dec(). The accounting is still correct, because NEW > means "not counted right now". But "was never counted" is wrong for such > entries. Could this comment be updated too? Later patches in the series > change neither comment. Will adjust it in a follow up patch: diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 2c15890bc56fe195d361e51faaea602e9d37a51c..ede6c15581242dc3fe6ecdb1ba0fab3ab601faa7 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -1897,8 +1897,8 @@ static void batadv_tt_local_unhash(struct batadv_priv *bat_priv, hlist_del_init_rcu(&tt_common->hash_entry); atomic_inc(&hash->generation); - /* An entry which still carries BATADV_TT_CLIENT_NEW was never counted - * and must not be uncounted here. + /* An entry which carries BATADV_TT_CLIENT_NEW is currently not counted + * because its ADD was not committed yet. It must not be uncounted here. */ if (!(tt_common->flags & BATADV_TT_CLIENT_NEW)) batadv_tt_local_size_dec(bat_priv, tt_common->key.vid); > [ ... ] > > > +/** > > + * batadv_tt_local_commit_change() - apply a committed change to the local table > > + * @bat_priv: the bat priv with all the mesh interface information > > + * @change: the change which is announced with the new ttvn > > + * > > + * The CRC and the full table responses of a ttvn must reflect exactly the > > + * changes announced with it. Only the entry affected by a committed change is > > + * therefore modified. An entry which was added or marked for removal after the > > + * change set was taken stays in its current state until its own change is > > + * committed with a later ttvn. [...] > [Severity: Medium] > Does this fully meet the invariant in the kernel-doc above ("must > reflect exactly the changes announced with it") when flags change? > > The CRC-relevant flags BATADV_TT_CLIENT_WIFI and BATADV_TT_CLIENT_ISOLA > are in BATADV_TT_SYNC_MASK. They are still written to the live entry > when their ADD is queued, not when that ADD is committed. That happens > in batadv_tt_local_refresh_locked(), reached through > batadv_tt_local_add()->batadv_tt_local_refresh(). Yes, this is a known limitation (already a problem before this patch) and there is currently no solution for it. Regards, Sven