From mboxrd@z Thu Jan 1 00:00:00 1970 From: dsahern@kernel.org Subject: [PATCH RFC net-next 1/5] net/netlink: Pass extack to dump callbacks Date: Fri, 28 Sep 2018 08:44:58 -0700 Message-ID: <20180928154502.9983-2-dsahern@kernel.org> References: <20180928154502.9983-1-dsahern@kernel.org> Cc: christian@brauner.io, jbenc@redhat.com, stephen@networkplumber.org, David Ahern To: netdev@vger.kernel.org, davem@davemloft.net Return-path: Received: from mail.kernel.org ([198.145.29.99]:48598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729124AbeI1WJZ (ORCPT ); Fri, 28 Sep 2018 18:09:25 -0400 In-Reply-To: <20180928154502.9983-1-dsahern@kernel.org> Sender: netdev-owner@vger.kernel.org List-ID: From: David Ahern Pass extack to dump callbacks by adding extack to netlink_dump_control and transferring to netlink_callback. Update rtnetlink as the first user. Signed-off-by: David Ahern --- include/linux/netlink.h | 2 ++ net/core/rtnetlink.c | 1 + net/netlink/af_netlink.c | 1 + 3 files changed, 4 insertions(+) diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 71f121b66ca8..8fc90308a653 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -176,6 +176,7 @@ struct netlink_callback { void *data; /* the module that dump function belong to */ struct module *module; + struct netlink_ext_ack *extack; u16 family; u16 min_dump_alloc; unsigned int prev_seq, seq; @@ -197,6 +198,7 @@ struct netlink_dump_control { int (*done)(struct netlink_callback *); void *data; struct module *module; + struct netlink_ext_ack *extack; u16 min_dump_alloc; }; diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 35162e1b06ad..da91b38297d3 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -4689,6 +4689,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, .dump = dumpit, .min_dump_alloc = min_dump_alloc, .module = owner, + .extack = extack }; err = netlink_dump_start(rtnl, skb, nlh, &c); /* netlink_dump_start() will keep a reference on diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index e3a0538ec0be..7d9e735b32c4 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2307,6 +2307,7 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb, cb->module = control->module; cb->min_dump_alloc = control->min_dump_alloc; cb->skb = skb; + cb->extack = control->extack; if (control->start) { ret = control->start(cb); -- 2.11.0