๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21972

Re: [PATCH net-next 01/15] batman-adv: document refcount of returned objects

#21972
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 17:20
88 lines
11350 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 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
Technical Details
Message-ID: <179554083742.3135.4885971613759489815@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-370607-linux-kernel-netdev=dewy.ru
References: <20261123171827.3294525-2-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-370607-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 01/15] batman-adv: document refcount of returned objects
Date: Tue, 24 Nov 2026 17:20:37 +0000
Organization: Usenet Network
Message-ID: <179554083742.3135.4885971613759489815@kernel.org>
References: <20261123171827.3294525-2-sw@simonwunderlich.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4188551"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:STIfbkkw+G2w3wkwxuowpbFfmj4= sha256:eeXh43GDzBQXDNXAMHnFBu5NhtaW3X/6VvKihwSxsoc=
	sha1:A1N4ghZ4i4QiY7NtiSkPv0EjeFk= sha256:+uXdEYSiM/o8w3Qi9/vYawxQB8qQPtq1c8MYBrAtYvM=
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 755BC125E2D; Tue, 24 Nov 2026 20:20:56 +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 Hh5FacadJTek;
	Tue, 24 Nov 2026 20:20:52 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370607-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 67C4A125E2A; Tue, 24 Nov 2026 20:20:44 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 7E99423255; Tue, 24 Nov 2026 17:20:39 +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=1795540839;
	b=CGMe2SCWg65Po2xs0mZphQpDRMgKJxf/ud666jI/CD/07QIeFezxBWuBsLRQuD2qN2xm
	 fLx+KhFAiE7t5Muns51O1CKdKnYqbVSs1Gi6lYjMMe0kVI5T68DD+d3EkE+FUnpbLed5k
	 w7mo4x7mVlcptjERFikX7AVnjwfLvkiZm8mURgsR0IPtwFnw0/JlCirYGF3bii0+k21r4
	 ExAN1HlJBFbumiZ4/y/MABE4xjBh+8CdClsCiCb1Yl2XgCtg/qd1UD98bdf1iREpjzQaP
	 p4G8GyAKBhbzpa5F0kbzZq1z4+xG5trdVbs4QTTVW/91gYte4rBYViLs+2hhHuwx4Uw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795540839;
	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=X8JHW0SkUZKnUVH13i74k2v1LzOsJddb26647MR2yus=;
	b=5Scb4rTAv3vy14E/zGN+hF5uU4ZAwb6r9nD3QeHy6s5CaGQe7e2/v8alVJL729KvsfVb
	 kLGIYL7ljk9TpwHqsc8yQbHLquRz2VemUqzUUPP5sAK/hbKQn/xqP+Ah+ObMr9mSfqFPX
	 TQaqGAEHljLhPhyMDHPheUVbhTTDOMh8BXbGNTxbZ4qhFNxVTpDSzZL9K02chvLz9hsqc
	 /h+O4inOuxKCMr28DLUGZo04gVRBPmSwOgd1t32vJMIwnEXMMTbNM8f9pcoGrZJo7bqfV
	 JCH9WpFCTu5tXrAxat1PshSGZpMcbNLgSX1LN0cuoq9BLDN/Nfgplhh3DfwRAELeeWg==
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=AlQlFrxo;
	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 5824A606A334;
	Tue, 24 Nov 2026 17:20:39 +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=AlQlFrxo
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=1795540838;
	b=xBYL7HUWeeV2EfWUHg35izN851UGO8hOSzeBSTFNHBQvOMgXLby3Rem2FaIhHP9YNz7P
	 kfQ6sgvOx+XLPJOHi8veISaUHENi2pwwZrJW+8c1Jux5fGzlH9FZG0q6pGMhegMcX0Rnp
	 mOSur5Mizpthl9xWHEJSPQqyQPgxwM8mbkoP9JRONJ5csPbhBN6IZRekjepX62lP+q0DT
	 wfihugjCgpN7/fWVyAYT2nCC9gVKh+VZDBUK7t1S4hFOx8MVmE0gzs5uegkZxeHz2P8bL
	 ucEShHWQH1unmgxFXAHQwK5TXCnYuWng9MsLXw7L4B/r1nG61XqMmJRODMnthGu1ffg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795540838;
	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=X8JHW0SkUZKnUVH13i74k2v1LzOsJddb26647MR2yus=;
	b=mkmREoHmDQUQiXEYuZn/SEC7zuZ8zFQs7l2M2A4FIwu3kfeU2Ae7vLlUpOfJr0fpqlh3
	 BWs1RtLqEY0RUrVyoaQOJi617GNPQMa9wfTSShlFFEOUcktWgaRATlkeFH14J5DalKJyW
	 qzQMZ/fvUDrsGotOWbD4evW0HAwxX3DPfoNI+ola/2ev8wl5j40HzTlWlcJFh8krXpAkk
	 nCqiE6HY26iv77XULOT0cVQTopFTb6x0YAb8eN+apdYCUIyTko0N2DfTAnpGs21Za7cSh
	 cW1mQ/kZo0PB/gKlKHRDfzUM7NwiZPTj1gtz0gaA0xaKVndju0EalKI0M17wHPz55rg==
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=AlQlFrxo;
	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 769CC606A326
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 17:20:38 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D76A01F000E6;
	Tue, 24 Nov 2026 17:20:37 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795540838;
	bh=X8JHW0SkUZKnUVH13i74k2v1LzOsJddb26647MR2yus=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=AlQlFrxoaSA6KFjAOJaJxy9YUcC3gMUpEl3ef3axLSRwEjE5gr6YnZ+TWs6OKLGRN
	 2vQUfj1tyzROl7BsEngwdRKBbCjEIXmw1VokiPedLHjCyhYNNpJc4nT7SzaDutNFgb
	 ONZCoty29WNi2NiVn82ZIj6pcPrX79s4xAOoDTrkX8PbE4hQ7n1L/Z9YMqTYnG6yeC
	 ojxMi4MsbYPp+NLWW3czyaw281I93kxKuT/Geg5In4jC6ndRhOsqUizGSyX+Yz//Z4
	 ouRQt5iM1GR4FWsDnfEz3f5CyIfIM82KM8MHKEthVVmaPgkUk1GG05S6kfIxinbFda
	 rpiFMKY899NzQ==
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-2-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