From patchwork Mon Oct 16 07:48:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17102 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 89F5281B9C; Mon, 16 Oct 2017 09:49:23 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=openmesh-com.20150623.gappssmtp.com header.i=@openmesh-com.20150623.gappssmtp.com header.b="lSajITQW"; dkim-atps=neutral Received-SPF: None (mailfrom) identity=mailfrom; client-ip=2607:f8b0:400d:c0d::22a; helo=mail-qt0-x22a.google.com; envelope-from=sven.eckelmann@openmesh.com; receiver= Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) by open-mesh.org (Postfix) with ESMTPS id D6E06803E6 for ; Mon, 16 Oct 2017 09:48:37 +0200 (CEST) Received: by mail-qt0-x22a.google.com with SMTP id 8so29854230qtv.1 for ; Mon, 16 Oct 2017 00:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openmesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c5RAV5/O55dCBXG/CxsjXMVuuUWJnRKzYBNowegfJLc=; b=lSajITQWn5lkVHFpAzpb3Hob3wAZaIn7x6h5Trlg3X0hzjNXJdq/8uY0Md8nP+5Feg 6yiEpJo/07zIDWFdcGiT7TNLZenc+Yd5OO7evV3/F2Mhb/s2Xk+/Yo01MwiRJiMBxO8h YzDIHzJds4m6mns0rMM415E5EXBd1goTgfUjtbsiRpYp9cw/mrwwAoKbN/vYfIC+bAhY Jwiaa9AJOR1YCI9xr3x4ciAVvjoB+k9nIP3oPTpnD1ayrIVafk1MeR8xZLox2W29vi1X xv2T/Q9qMBkeAoL1z+Km8o3YQOTRy3qJKWLuzG5iqBAKG/2eKNUSqh+2Q4x4jzICKXxk TDjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c5RAV5/O55dCBXG/CxsjXMVuuUWJnRKzYBNowegfJLc=; b=H/YzhxdyWdrlRWEjTNdom13PMgYzqH36ZrSv39YJbxzVMDx28W32PcPWITXXtPc+yg OdYIzead4cqcxZ+zR9XjrN1Lj1W1TsChW8fX938Vb4vR5k5vQixLWtiMNoNoimM+Trbi Xl8WBdL4nHzfiZ/4Qr/hA5CQaPxlzaHjiM/hzkpsPFQn1U0kSyTjUhqWByGxT5wL1F6o vIM+SrsfS4rDeJKWHQwW7TZc/i14bF27uiPd8bgrhWcJVe1AXiA2DJC5CLxDZD7MLYDy 5lS60Cfd4H8DmzfEd3ncOB2SmP5qvX+CR9esuj44ZOeAutkigSF2mBF0IOixbWNR1mkh gHgg== X-Gm-Message-State: AMCzsaVj/4qOE7L0pg2N4sDZHYtG2xY4bAmiLVJJ9+enV4LLFpr/3Sam j7enTaaYJNMIw+DclVMvPiFN/Q6z X-Google-Smtp-Source: ABhQp+Topn9s+H4mBrwoGs5VHw02Sx+oTAnrfMRmAu9Lf1dPSiXTwL6qUeAuzVXtrmnSsFmiTNlzLw== X-Received: by 10.200.17.146 with SMTP id d18mr5013734qtj.61.1508140115890; Mon, 16 Oct 2017 00:48:35 -0700 (PDT) Received: from sven-desktop.home.narfation.org (p2003007C6F65A1FE9C6154504586EBD3.dip0.t-ipconnect.de. [2003:7c:6f65:a1fe:9c61:5450:4586:ebd3]) by smtp.gmail.com with ESMTPSA id q206sm4128402qke.54.2017.10.16.00.48.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 00:48:35 -0700 (PDT) From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 16 Oct 2017 09:48:03 +0200 Message-Id: <20171016074803.17947-1-sven.eckelmann@openmesh.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Avoid spurious warnings from bat_v neigh_cmp implementation X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Cc: Joseph Stefek , Antonio Quartulli , =?utf-8?q?Steffen_F=C3=B6rster?= , Sven Eckelmann Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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 Acked-by: Antonio Quartulli --- Cc: Antonio Quartulli 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;