lkml.org 
[lkml]   [2022]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC net-next] bonding: netlink error message support for options
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.

\
 
 \ /
  Last update: 2022-05-18 00:34    [W:0.061 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site