Subject: Re: [PATCH net-next v2 1/1] bridge: return error code when deleting Vlan

From: Roman Mashak <[email-masked]>
Date: Fri, 13 Oct 2017 12:00:53 -0400

Nikolay Aleksandrov <[email-masked]> writes:

[...]

>>> Why do you want to return the error code here? Walking the code paths
>>> seems like ENOENT or err from switchdev_port_obj_del are the 2 error
>>> possibilities.
>> 
>> For example, if you attempt to delete a non-existing vlan on a port,
>> the current code succeeds and also sends event :
>> 
>> rtnetlink_rcv_msg
>>     rtnl_bridge_dellink
>>        br_dellink
>>           br_afspec
>>              br_vlan_info
>> 
>> int br_dellink(..)
>> {
>>   ...
>>   err = br_afspec()
>>   if (err == 0)
>>       br_ifinfo_notify(RTM_NEWLINK, p);
>> }
>> 
>> This is misleading, so a proper errcode has to be produced.
>> 
>
> True, but you also change the expected behaviour because now a user can
> clear all vlans with one request (1 - 4094), and after the change that
> will fail with a partial delete if some vlan was missing.

Nikolay, would you like to have a crack at fixing this?

> This has been the behaviour forever and some script might depend on it.
> Also IMO, and as David also mentioned, doing a partial delete is not good.