All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation
@ 2017-10-16  7:48 Sven Eckelmann
  2017-10-16  8:53 ` Antonio Quartulli
  2017-10-16 17:11 ` Sven Eckelmann
  0 siblings, 2 replies; 3+ messages in thread
From: Sven Eckelmann @ 2017-10-16  7:48 UTC (permalink / raw)
  To: b.a.t.m.a.n
  Cc: Joseph Stefek, Steffen Förster, Sven Eckelmann, Antonio Quartulli

The neighbor compare API implementation for B.A.T.M.A.N. V checks whether
the neigh_ifinfo for this neighbor on a specific interface exists. A
warning is printed when it isn't found.

But it is not called inside a lock which would prevent that this
information is lost right before batadv_neigh_ifinfo_get. It must therefore
be expected that batadv_v_neigh_(cmp|is_sob) might not be able to get the
requested neigh_ifinfo.

A WARN_ON for such a situation seems not to be appropriate because this
will only flood the kernel logs. The warnings must therefore be removed.

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
---
Cc: Antonio Quartulli <a@unstable.cc>

This patch is for https://www.open-mesh.org/issues/343
---
 net/batman-adv/bat_v.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c
index 93ef1c0..69436d2 100644
--- a/net/batman-adv/bat_v.c
+++ b/net/batman-adv/bat_v.c
@@ -623,11 +623,11 @@ static int batadv_v_neigh_cmp(struct batadv_neigh_node *neigh1,
 	int ret = 0;
 
 	ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1);
-	if (WARN_ON(!ifinfo1))
+	if (!ifinfo1)
 		goto err_ifinfo1;
 
 	ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2);
-	if (WARN_ON(!ifinfo2))
+	if (!ifinfo2)
 		goto err_ifinfo2;
 
 	ret = ifinfo1->bat_v.throughput - ifinfo2->bat_v.throughput;
@@ -649,11 +649,11 @@ static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,
 	bool ret = false;
 
 	ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1);
-	if (WARN_ON(!ifinfo1))
+	if (!ifinfo1)
 		goto err_ifinfo1;
 
 	ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2);
-	if (WARN_ON(!ifinfo2))
+	if (!ifinfo2)
 		goto err_ifinfo2;
 
 	threshold = ifinfo1->bat_v.throughput / 4;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation
  2017-10-16  7:48 [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation Sven Eckelmann
@ 2017-10-16  8:53 ` Antonio Quartulli
  2017-10-16 17:11 ` Sven Eckelmann
  1 sibling, 0 replies; 3+ messages in thread
From: Antonio Quartulli @ 2017-10-16  8:53 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking,
	Sven Eckelmann
  Cc: Joseph Stefek, Steffen Förster


[-- Attachment #1.1: Type: text/plain, Size: 922 bytes --]



On 16/10/17 15:48, Sven Eckelmann wrote:
> The neighbor compare API implementation for B.A.T.M.A.N. V checks whether
> the neigh_ifinfo for this neighbor on a specific interface exists. A
> warning is printed when it isn't found.
> 
> But it is not called inside a lock which would prevent that this
> information is lost right before batadv_neigh_ifinfo_get. It must therefore
> be expected that batadv_v_neigh_(cmp|is_sob) might not be able to get the
> requested neigh_ifinfo.
> 
> A WARN_ON for such a situation seems not to be appropriate because this
> will only flood the kernel logs. The warnings must therefore be removed.
> 
> Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>

Yeah, this makes sense. As a read only operation, the lock is not held
on purpose, therefore such situation has to be expected.

Acked-by: Antonio Quartulli <a@unstable.cc>

-- 
Antonio Quartulli


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation
  2017-10-16  7:48 [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation Sven Eckelmann
  2017-10-16  8:53 ` Antonio Quartulli
@ 2017-10-16 17:11 ` Sven Eckelmann
  1 sibling, 0 replies; 3+ messages in thread
From: Sven Eckelmann @ 2017-10-16 17:11 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Joseph Stefek, Antonio Quartulli, Steffen Förster

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

On Montag, 16. Oktober 2017 09:48:03 CEST Sven Eckelmann wrote:
> The neighbor compare API implementation for B.A.T.M.A.N. V checks whether
> the neigh_ifinfo for this neighbor on a specific interface exists. A
> warning is printed when it isn't found.
> 
> But it is not called inside a lock which would prevent that this
> information is lost right before batadv_neigh_ifinfo_get. It must therefore
> be expected that batadv_v_neigh_(cmp|is_sob) might not be able to get the
> requested neigh_ifinfo.
> 
> A WARN_ON for such a situation seems not to be appropriate because this
> will only flood the kernel logs. The warnings must therefore be removed.
> 
> Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
> ---
> Cc: Antonio Quartulli <a@unstable.cc>
> 
> This patch is for https://www.open-mesh.org/issues/343

Patch was applied in 0dee8aba [1]

Kind regards,
	Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/0dee8aba4702f82197ed3428ede6b3884fdff5ca

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-16 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16  7:48 [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation Sven Eckelmann
2017-10-16  8:53 ` Antonio Quartulli
2017-10-16 17:11 ` Sven Eckelmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.