I looked, and there are a couple of cases in bonding that don't
have RTNL for adjusting priv_flags (in bond_ab_arp_probe when no slaves
are up, and a couple of cases in 802.3ad). I think the solution there
is to move bonding away from priv_flags for some of this (e.g., convert
bonding to use a frame hook like bridge and macvlan, and greatly
simplify skb_bond_should_drop), but that's a separate topic.
The majority of the cases, however, do hold RTNL. Bonding
generally doesn't have to acquire RTNL itself, since whatever called
into bonding is holding it already. For example, the slave add and
remove paths (bond_enslave, bond_release) are called either via sysfs or
ioctl, both of which acquire RTNL. All of the set and clear operations
for IFF_BONDING fall into this category; look at bonding_store_slaves
for an example.
Bonding does acquire RTNL itself when performing failovers,
e.g., bond_mii_monitor holds RTNL prior to calling bond_miimon_commit,
which will change priv_flags.
-J
---
-Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com
--