All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jay Vosburgh <jay.vosburgh@canonical.com>
Cc: Jonathan Toppins <jtoppins@redhat.com>,
	netdev@vger.kernel.org, Veaceslav Falico <vfalico@gmail.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC net-next] bonding: netlink error message support for options
Date: Tue, 17 May 2022 15:33:26 -0700	[thread overview]
Message-ID: <20220517153326.1fbbe2cc@kernel.org> (raw)
In-Reply-To: <2125.1652821874@famine>

On Tue, 17 May 2022 14:11:14 -0700 Jay Vosburgh wrote:
> 	If I'm reading the code correctly, rtnl isn't held that long.
> Once the ->doit() returns, rtnl is dropped, but the copy happens later:
> 
> rtnetlink_rcv()
> 	netlink_rcv_skb(skb, &rtnetlink_rcv_msg)
> 		rtnetlink_rcv_msg()	[ as cb(skb, nlh, &extack) ]
> 			rtnl_lock()
> 			link->doit()	[ rtnl_setlink, rtnl_newlink, et al ]
> 			rtnl_unlock()
> 		netlink_ack()
> 
> inside netlink_ack():
> 
>         if (nlk_has_extack && extack) {
>                 if (extack->_msg) {
>                         WARN_ON(nla_put_string(skb, NLMSGERR_ATTR_MSG,
>                                                extack->_msg));
>                 }

Indeed.

> 	Even if the strings have to be constant (via NL_SET_ERR_MSG),
> adding extack messages is likely still an improvement.

At a quick glance it seems like the major use of the printf here is to
point at a particular option. If options are carried in individual
attributes pointing at the right attribute with NL_SET_ERR_MSG_ATTR()
should also be helpful. Maybe that's stating the obvious.

  reply	other threads:[~2022-05-17 22:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 20:31 [RFC net-next] bonding: netlink error message support for options Jonathan Toppins
2022-05-17 21:11 ` Jay Vosburgh
2022-05-17 22:33   ` Jakub Kicinski [this message]
2022-05-17 22:44 ` Stephen Hemminger
2022-05-17 23:54   ` Jakub Kicinski
2022-05-18  3:37     ` Jonathan Toppins
2022-05-27 19:59 ` [RFC net-next v2] " Jonathan Toppins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220517153326.1fbbe2cc@kernel.org \
    --to=kuba@kernel.org \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jay.vosburgh@canonical.com \
    --cc=jtoppins@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vfalico@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.