Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808599/?format=api
{ "id": 808599, "url": "http://patchwork.ozlabs.org/api/patches/808599/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170901091517.31271-1-idosch@mellanox.com/", "project": { "id": 7, "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api", "name": "Linux network development", "link_name": "netdev", "list_id": "netdev.vger.kernel.org", "list_email": "netdev@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170901091517.31271-1-idosch@mellanox.com>", "list_archive_url": null, "date": "2017-09-01T09:15:17", "name": "[net-next] net: Add module reference to FIB notifiers", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "908877c6e3a628864d41ab5baaee746825ce8d80", "submitter": { "id": 67403, "url": "http://patchwork.ozlabs.org/api/people/67403/?format=api", "name": "Ido Schimmel", "email": "idosch@mellanox.com" }, "delegate": { "id": 34, "url": "http://patchwork.ozlabs.org/api/users/34/?format=api", "username": "davem", "first_name": "David", "last_name": "Miller", "email": "davem@davemloft.net" }, "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170901091517.31271-1-idosch@mellanox.com/mbox/", "series": [ { "id": 981, "url": "http://patchwork.ozlabs.org/api/series/981/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=981", "date": "2017-09-01T09:15:17", "name": "[net-next] net: Add module reference to FIB notifiers", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/981/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808599/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808599/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<netdev-owner@vger.kernel.org>", "X-Original-To": "patchwork-incoming@ozlabs.org", "Delivered-To": "patchwork-incoming@ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=Mellanox.com header.i=@Mellanox.com\n\theader.b=\"prXsaKyX\"; dkim-atps=neutral", "spf=none (sender IP is )\n\tsmtp.mailfrom=idosch@mellanox.com; " ], "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkDB73xvVz9t32\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 1 Sep 2017 19:15:59 +1000 (AEST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751705AbdIAJP5 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 1 Sep 2017 05:15:57 -0400", "from mail-eopbgr40070.outbound.protection.outlook.com\n\t([40.107.4.70]:25058\n\t\"EHLO EUR03-DB5-obe.outbound.protection.outlook.com\"\n\trhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP\n\tid S1751511AbdIAJPz (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tFri, 1 Sep 2017 05:15:55 -0400", "from shredder.mtl.com (79.179.121.124) by\n\tHE1PR0501MB2010.eurprd05.prod.outlook.com (2603:10a6:3:35::12) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9;\n\tFri, 1 Sep 2017 09:15:46 +0000" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n\ts=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=Nk8dZkYywxWwinVHHek3a568gBi7F0Ujxze7tJVR0nA=;\n\tb=prXsaKyXEn+C2Dljz+VvB93fvdq2msYPoWGgHejpOD0HSTohLcf7rkiGr8qrvO6qYW7uSP0cpCDjwl3+p4r2TZwXR/Vpe60iaJGd9sYgb6S+hFHbz+dIzgRVKWvom6hyDJPqG2zF5E/T39BIwr7yWh6R+ZXxuzHMeF/q4pIOPQA=", "From": "Ido Schimmel <idosch@mellanox.com>", "To": "netdev@vger.kernel.org", "Cc": "davem@davemloft.net, jiri@mellanox.com, dsahern@gmail.com,\n\tmlxsw@mellanox.com, Ido Schimmel <idosch@mellanox.com>", "Subject": "[PATCH net-next] net: Add module reference to FIB notifiers", "Date": "Fri, 1 Sep 2017 12:15:17 +0300", "Message-Id": "<20170901091517.31271-1-idosch@mellanox.com>", "X-Mailer": "git-send-email 2.13.5", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[79.179.121.124]", "X-ClientProxiedBy": "VI1P190CA0004.EURP190.PROD.OUTLOOK.COM\n\t(2603:10a6:802:2b::17) To HE1PR0501MB2010.eurprd05.prod.outlook.com\n\t(2603:10a6:3:35::12)", "X-MS-PublicTrafficType": "Email", "X-MS-Office365-Filtering-Correlation-Id": "ade03897-6afb-42cc-4b00-08d4f11a088f", "X-MS-Office365-Filtering-HT": "Tenant", "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:HE1PR0501MB2010; ", "X-Microsoft-Exchange-Diagnostics": [ "1; HE1PR0501MB2010;\n\t3:xFSgCUJT+zvciAptR1XLQwgw15+8hNxg6RQ3I+DWd4YCpFkIHncKpQY1et/4qKokk7GXoS+ErMkF9S+jTYAFYATXW6JYASlExpEWmik960acSWFbc6IetG4mtaFEOZ2vR8kGGQHpKrcJexGRqbUaX788GnpaOQ0OtDPAZytpLCxxfziQ6QaFSCDjx5PCRLHNEZc6UoDdYeAnXHOgeyhbt9OyJ9kxT7A43nTP4qw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bBZ2+tUpd+5O8=;\n\t7:dXa8LvX7Bde0rB6iEo2L8XwIdBG6m/oe9abyPya9hG2Lh99z/pXJGULiwpOtdR8nVe86OVTVNkOsW/TFlBfT+zMoRt1US8SRUxVERIo5yn1Oo4kaEbv7H61BFot+HxMcHk9/v4kQBmuqpAXF0IhxQzUqiHrfP+tg+MfQmDP7hvD0oiYkGZfoZA85vmrd9ps1Mgx95dkOTBqpZ7Y388fvRCVbF0dQVB8I2MtVNMyXoHo=" ], "X-MS-TrafficTypeDiagnostic": "HE1PR0501MB2010:", "X-Exchange-Antispam-Report-Test": "UriScan:;", "X-Microsoft-Antispam-PRVS": "<HE1PR0501MB2010746EFC64C42A9523ACB6BF920@HE1PR0501MB2010.eurprd05.prod.outlook.com>", "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:HE1PR0501MB2010; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:HE1PR0501MB2010; ", "X-Forefront-PRVS": "0417A3FFD2", "X-Forefront-Antispam-Report": "SFV:NSPM;\n\tSFS:(10009020)(7370300001)(4630300001)(6009001)(39860400002)(189002)(199003)(6506006)(50986999)(7350300001)(8676002)(305945005)(6486002)(53416004)(50466002)(101416001)(66066001)(81166006)(68736007)(81156014)(50226002)(7736002)(1076002)(47776003)(48376002)(2351001)(36756003)(106356001)(189998001)(2361001)(3846002)(4326008)(6116002)(2906002)(6512007)(6666003)(53936002)(6916009)(478600001)(86362001)(42186005)(25786009)(105586002)(97736004)(5003940100001)(5660300001)(33646002)(110136004)(107886003);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2010;\n\tH:shredder.mtl.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1;\n\tA:1; LANG:en; ", "Received-SPF": "None (protection.outlook.com: mellanox.com does not designate\n\tpermitted sender hosts)", "SpamDiagnosticOutput": "1:99", "SpamDiagnosticMetadata": "NSPM", "X-OriginatorOrg": "Mellanox.com", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "01 Sep 2017 09:15:46.5509\n\t(UTC)", "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "HE1PR0501MB2010", "Sender": "netdev-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<netdev.vger.kernel.org>", "X-Mailing-List": "netdev@vger.kernel.org" }, "content": "When a listener registers to the FIB notification chain it receives a\ndump of the FIB entries and rules from existing address families by\ninvoking their dump operations.\n\nWhile we call into these modules we need to make sure they aren't\nremoved. Do that by increasing their reference count before invoking\ntheir dump operations and decrease it afterwards.\n\nFixes: 04b1d4e50e82 (\"net: core: Make the FIB notification chain generic\")\nSigned-off-by: Ido Schimmel <idosch@mellanox.com>\nReviewed-by: Jiri Pirko <jiri@mellanox.com>\n---\n include/net/fib_notifier.h | 2 ++\n net/core/fib_notifier.c | 13 +++++++++++--\n net/ipv4/fib_notifier.c | 2 ++\n net/ipv6/fib6_notifier.c | 2 ++\n 4 files changed, 17 insertions(+), 2 deletions(-)", "diff": "diff --git a/include/net/fib_notifier.h b/include/net/fib_notifier.h\nindex 241475224f74..669b9716dc7a 100644\n--- a/include/net/fib_notifier.h\n+++ b/include/net/fib_notifier.h\n@@ -2,6 +2,7 @@\n #define __NET_FIB_NOTIFIER_H\n \n #include <linux/types.h>\n+#include <linux/module.h>\n #include <linux/notifier.h>\n #include <net/net_namespace.h>\n \n@@ -26,6 +27,7 @@ struct fib_notifier_ops {\n \tstruct list_head list;\n \tunsigned int (*fib_seq_read)(struct net *net);\n \tint (*fib_dump)(struct net *net, struct notifier_block *nb);\n+\tstruct module *owner;\n \tstruct rcu_head rcu;\n };\n \ndiff --git a/net/core/fib_notifier.c b/net/core/fib_notifier.c\nindex 292aab83702f..4fc202dbdfb6 100644\n--- a/net/core/fib_notifier.c\n+++ b/net/core/fib_notifier.c\n@@ -2,6 +2,7 @@\n #include <linux/notifier.h>\n #include <linux/rcupdate.h>\n #include <linux/kernel.h>\n+#include <linux/module.h>\n #include <linux/init.h>\n #include <net/net_namespace.h>\n #include <net/fib_notifier.h>\n@@ -33,8 +34,12 @@ static unsigned int fib_seq_sum(void)\n \n \trtnl_lock();\n \tfor_each_net(net) {\n-\t\tlist_for_each_entry(ops, &net->fib_notifier_ops, list)\n+\t\tlist_for_each_entry(ops, &net->fib_notifier_ops, list) {\n+\t\t\tif (!try_module_get(ops->owner))\n+\t\t\t\tcontinue;\n \t\t\tfib_seq += ops->fib_seq_read(net);\n+\t\t\tmodule_put(ops->owner);\n+\t\t}\n \t}\n \trtnl_unlock();\n \n@@ -46,8 +51,12 @@ static int fib_net_dump(struct net *net, struct notifier_block *nb)\n \tstruct fib_notifier_ops *ops;\n \n \tlist_for_each_entry_rcu(ops, &net->fib_notifier_ops, list) {\n-\t\tint err = ops->fib_dump(net, nb);\n+\t\tint err;\n \n+\t\tif (!try_module_get(ops->owner))\n+\t\t\tcontinue;\n+\t\terr = ops->fib_dump(net, nb);\n+\t\tmodule_put(ops->owner);\n \t\tif (err)\n \t\t\treturn err;\n \t}\ndiff --git a/net/ipv4/fib_notifier.c b/net/ipv4/fib_notifier.c\nindex 5d7afb145562..cfd420b0572c 100644\n--- a/net/ipv4/fib_notifier.c\n+++ b/net/ipv4/fib_notifier.c\n@@ -2,6 +2,7 @@\n #include <linux/notifier.h>\n #include <linux/socket.h>\n #include <linux/kernel.h>\n+#include <linux/export.h>\n #include <net/net_namespace.h>\n #include <net/fib_notifier.h>\n #include <net/netns/ipv4.h>\n@@ -49,6 +50,7 @@ static const struct fib_notifier_ops fib4_notifier_ops_template = {\n \t.family\t\t= AF_INET,\n \t.fib_seq_read\t= fib4_seq_read,\n \t.fib_dump\t= fib4_dump,\n+\t.owner\t\t= THIS_MODULE,\n };\n \n int __net_init fib4_notifier_init(struct net *net)\ndiff --git a/net/ipv6/fib6_notifier.c b/net/ipv6/fib6_notifier.c\nindex 66a103ef7e86..05f82baaa99e 100644\n--- a/net/ipv6/fib6_notifier.c\n+++ b/net/ipv6/fib6_notifier.c\n@@ -1,6 +1,7 @@\n #include <linux/notifier.h>\n #include <linux/socket.h>\n #include <linux/kernel.h>\n+#include <linux/export.h>\n #include <net/net_namespace.h>\n #include <net/fib_notifier.h>\n #include <net/netns/ipv6.h>\n@@ -41,6 +42,7 @@ static const struct fib_notifier_ops fib6_notifier_ops_template = {\n \t.family\t\t= AF_INET6,\n \t.fib_seq_read\t= fib6_seq_read,\n \t.fib_dump\t= fib6_dump,\n+\t.owner\t\t= THIS_MODULE,\n };\n \n int __net_init fib6_notifier_init(struct net *net)\n", "prefixes": [ "net-next" ] }