Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: sw@simonwunderlich.de
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
Subject: Re: [PATCH net-next 01/15] batman-adv: document refcount of returned objects
Date: Tue, 24 Nov 2026 17:20:37 +0000	[thread overview]
Message-ID: <179554083742.3135.4885971613759489815@kernel.org> (raw)
In-Reply-To: <20261123171827.3294525-2-sw@simonwunderlich.de>

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 does not match the diff.

--

batman-adv: document refcount of returned objects

This patch adds a kerneldoc note to the batman-adv lookup, get and create
functions that return an object with an increased refcounter. For
batadv_transtable_best_orig() and batadv_mcast_forw_orig_entry(), it notes
the opposite: the returned object is only borrowed within the caller's
RCU read-side critical section.

> Add a note to the kerneldoc of the __must_check functions that return an
> object with an increased refcounter and did not document this yet. For the
> exceptions:

[Severity: Low]
This isn't a bug, but the commit message doesn't quite match the diff.

Earlier, the message gives "(with increased refcnt)" as an example of
wording that already documents this. The diff then removes that wording
and rewrites it in batadv_gw_get_selected_gw_node(),
batadv_gw_get_selected_orig(), batadv_hardif_get_by_netdev(),
batadv_primary_if_get_selected(), batadv_orig_hash_find() and all of the
netlink.c getters.

The same happens to "with an initialized reference counter" in
batadv_tt_local_create() and batadv_tt_global_create(). It also happens to
"it with an increased refcounter" in batadv_tt_global_orig_entry_find().

On the other hand, the other existing phrasing is left alone:

    * The object is returned with refcounter increased by 1.

It is still in batadv_orig_node_vlan_new(), batadv_orig_router_get(),
batadv_orig_ifinfo_get(), batadv_orig_ifinfo_new(),
batadv_neigh_ifinfo_get(), batadv_neigh_ifinfo_new() and
batadv_last_bonding_get().

So the patch does more than add notes where none existed, but it also
doesn't make all of the refcount wording consistent. Could the commit
message say that existing refcount wording is being rewritten?
Alternatively, could the remaining "increased by 1" comments be converted
too, so the wording is consistent?

> diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
> index e6e97c0478cc4..0dddcea7def9d 100644
> --- a/net/batman-adv/gateway_client.c
> +++ b/net/batman-adv/gateway_client.c
> @@ -74,7 +74,8 @@ void batadv_gw_node_release(struct kref *ref)
>   * batadv_gw_get_selected_gw_node() - Get currently selected gateway
>   * @bat_priv: the bat priv with all the mesh interface information
>   *
> - * Return: selected gateway (with increased refcnt), NULL on errors
> + * Return: selected gateway, NULL on errors.
> + * The returned object has an increased refcounter.
>   */

[ ... ]

> diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
> index f9de255ef0dfd..216f41387afa7 100644
> --- a/net/batman-adv/translation-table.c
> +++ b/net/batman-adv/translation-table.c

[ ... ]

> @@ -962,8 +965,8 @@ static bool batadv_tt_local_add_existing(struct batadv_priv *bat_priv,
>   * as BATADV_TT_CLIENT_NEW to avoid sending it in a full table response going
>   * out before the next ttvn increment (consistency check).
>   *
> - * Return: the new entry with an initialized reference counter on success, NULL
> - * otherwise.
> + * Return: the new entry on success, NULL otherwise.
> + * The returned object has an increased refcounter.
>   */

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123171827.3294525-2-sw%40simonwunderlich.de

  parent reply	other threads:[~2026-11-24 17:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 17:18 [PATCH net-next 00/15] pull request for net-next: batman-adv 2026-11-23 Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 01/15] batman-adv: document refcount of returned objects Simon Wunderlich
2026-11-23 17:23   ` netdev-bot+sinfo
2026-11-23 18:13     ` Sven Eckelmann
2026-11-24 17:20   ` netdev-bot+sashiko [this message]
2026-11-23 17:18 ` [PATCH net-next 02/15] batman-adv: mcast: use mla_lock also during mcast_free Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 03/15] batman-adv: mark functions inheriting critical sections Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 04/15] batman-adv: bla: register own backbone gw when claiming for local node Simon Wunderlich
2026-11-24 17:20   ` netdev-bot+sashiko
2026-11-23 17:18 ` [PATCH net-next 05/15] batman-adv: tt: unhash local entries with hlist_del_init_rcu() Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 06/15] batman-adv: tt: refresh local entry in single flags_lock section Simon Wunderlich
2026-11-24 17:20   ` netdev-bot+sashiko
2026-11-23 17:18 ` [PATCH net-next 07/15] batman-adv: tt: don't remove unhashed local entries Simon Wunderlich
2026-11-24 17:20   ` netdev-bot+sashiko
2026-11-23 17:18 ` [PATCH net-next 08/15] batman-adv: tt: don't queue local events for unhashed entries Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 09/15] batman-adv: tt: remove unannounced local entries via pending state Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 10/15] batman-adv: tt: keep local entry unchanged when ADD can't be queued Simon Wunderlich
2026-11-24 17:20   ` netdev-bot+sashiko
2026-11-23 17:18 ` [PATCH net-next 11/15] batman-adv: tt: requeue DEL of pending local entry after failed allocation Simon Wunderlich
2026-11-24 17:20   ` netdev-bot+sashiko
2026-11-23 17:18 ` [PATCH net-next 12/15] batman-adv: tt: extract removal of pending local entry Simon Wunderlich
2026-11-24 17:20   ` netdev-bot+sashiko
2026-11-23 17:18 ` [PATCH net-next 13/15] batman-adv: tt: commit only the announced local changes Simon Wunderlich
2026-11-24 17:20   ` netdev-bot+sashiko
2026-11-23 17:18 ` [PATCH net-next 14/15] batman-adv: tt: avoid list_lock for unchanged local clients Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 15/15] batman-adv: tt: drop ADD+DEL events of never announced clients Simon Wunderlich
2026-11-24 17:20   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179554083742.3135.4885971613759489815@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sven@narfation.org \
    --cc=sw@simonwunderlich.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox