From patchwork Wed Mar 28 01:21:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ahern X-Patchwork-Id: 891922 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=cumulusnetworks.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b="TAZ6GQOq"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 409qqV1Jw9z9s19 for ; Wed, 28 Mar 2018 12:22:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752846AbeC1BWK (ORCPT ); Tue, 27 Mar 2018 21:22:10 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:40315 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752594AbeC1BWI (ORCPT ); Tue, 27 Mar 2018 21:22:08 -0400 Received: by mail-pg0-f66.google.com with SMTP id g8so331568pgv.7 for ; Tue, 27 Mar 2018 18:22:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WAR1o+pcDVIcnukZ8jEI6zwBjALowaDWQc0ud9/Axko=; b=TAZ6GQOqcwbUbF+Ifeg6fKlxuA6JH09pFK9af+cTOVoWxToYdZxtLFrccBFhSnBPmb n6EgXvPfggVSUmoy6iQiA53oeDTMZWdxGHjf+iKpFc1IwuRgeoPymep9SXLTQHrjRMDL ErRCaIuHtnU2CvoyGLLNhteSH04a3kWyoi4nY= 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:in-reply-to :references; bh=WAR1o+pcDVIcnukZ8jEI6zwBjALowaDWQc0ud9/Axko=; b=WE9vimw8yLKP8FpnMX+wiXmHvVibCaK3d5MxqV6CTFRZrzQ4GnalfVL1T9O1VGmSau dQx/zevFzE5/3BqYNnoF/52n4in1D70zeTyk5Zy25bEZOw4TMJftvnBhn1TYhbyug5wI BTvQh/JgPYthRttTl4k7WlJSMHPjOR6hNlhIKrFZ6LVCsYMjJecGFfvseNUZJlNe0tkB pA/zbHyeR8EM3AiMzqEKPSiJjTy91KpO+VrfmGUahez6obH3TEzq5BDcOTLeowWAn/E2 O0WX+7earu1Ujip7MokGI6FD5iL9u7WcY9iW9xebTbTCkLfBsz67riufnvix4TMYq7Pn UMMg== X-Gm-Message-State: AElRT7HKAO7Uz/65dqfrUjeMGRGgManEXZzOX7uzbZ4MVCrkFjEDShxx VcraWQCgJ3moW6cGiwq8qbJUqgKH X-Google-Smtp-Source: AIpwx48TLjeG9yEAgJKei5glcGJgreaYSeNSJVEAi3KS3/iUQelMIAc4aS2yMjqqPB65tF4BKItThQ== X-Received: by 10.98.107.138 with SMTP id g132mr1211883pfc.163.1522200128013; Tue, 27 Mar 2018 18:22:08 -0700 (PDT) Received: from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com. [216.129.126.126]) by smtp.googlemail.com with ESMTPSA id y18sm4798595pfe.67.2018.03.27.18.22.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Mar 2018 18:22:06 -0700 (PDT) From: David Ahern To: netdev@vger.kernel.org Cc: davem@davemloft.net, roopa@cumulusnetworks.com, shm@cumulusnetworks.com, jiri@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, andy.roulin@gmail.com, David Ahern Subject: [PATCH net-next 1/6] net: Fix fib notifer to return errno Date: Tue, 27 Mar 2018 18:21:55 -0700 Message-Id: <20180328012200.15175-2-dsa@cumulusnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180328012200.15175-1-dsa@cumulusnetworks.com> References: <20180328012200.15175-1-dsa@cumulusnetworks.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Notifier handlers use notifier_from_errno to convert any potential error to an encoded format. As a consequence the other side, call_fib_notifier{s} in this case, needs to use notifier_to_errno to return the error from the handler back to its caller. Signed-off-by: David Ahern Reviewed-by: Ido Schimmel --- net/core/fib_notifier.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c index 0c048bdeb016..b793b523aba3 100644 --- a/net/core/fib_notifier.c +++ b/net/core/fib_notifier.c @@ -13,16 +13,22 @@ int call_fib_notifier(struct notifier_block *nb, struct net *net, enum fib_event_type event_type, struct fib_notifier_info *info) { + int err; + info->net = net; - return nb->notifier_call(nb, event_type, info); + err = nb->notifier_call(nb, event_type, info); + return notifier_to_errno(err); } EXPORT_SYMBOL(call_fib_notifier); int call_fib_notifiers(struct net *net, enum fib_event_type event_type, struct fib_notifier_info *info) { + int err; + info->net = net; - return atomic_notifier_call_chain(&fib_chain, event_type, info); + err = atomic_notifier_call_chain(&fib_chain, event_type, info); + return notifier_to_errno(err); } EXPORT_SYMBOL(call_fib_notifiers);