Skip to content

Commit 6a4bc44

Browse files
ecsvsimonwunderlich
authored andcommitted
batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation
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 <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]>
1 parent bad5680 commit 6a4bc44

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

net/batman-adv/bat_v.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "main.h"
2020

2121
#include <linux/atomic.h>
22-
#include <linux/bug.h>
2322
#include <linux/cache.h>
2423
#include <linux/errno.h>
2524
#include <linux/if_ether.h>
@@ -623,11 +622,11 @@ static int batadv_v_neigh_cmp(struct batadv_neigh_node *neigh1,
623622
int ret = 0;
624623

625624
ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1);
626-
if (WARN_ON(!ifinfo1))
625+
if (!ifinfo1)
627626
goto err_ifinfo1;
628627

629628
ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2);
630-
if (WARN_ON(!ifinfo2))
629+
if (!ifinfo2)
631630
goto err_ifinfo2;
632631

633632
ret = ifinfo1->bat_v.throughput - ifinfo2->bat_v.throughput;
@@ -649,11 +648,11 @@ static bool batadv_v_neigh_is_sob(struct batadv_neigh_node *neigh1,
649648
bool ret = false;
650649

651650
ifinfo1 = batadv_neigh_ifinfo_get(neigh1, if_outgoing1);
652-
if (WARN_ON(!ifinfo1))
651+
if (!ifinfo1)
653652
goto err_ifinfo1;
654653

655654
ifinfo2 = batadv_neigh_ifinfo_get(neigh2, if_outgoing2);
656-
if (WARN_ON(!ifinfo2))
655+
if (!ifinfo2)
657656
goto err_ifinfo2;
658657

659658
threshold = ifinfo1->bat_v.throughput / 4;

0 commit comments

Comments
 (0)