From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Mashak Subject: Re: [PATCH net-next v2 1/1] bridge: return error code when deleting Vlan Date: Fri, 13 Oct 2017 12:00:53 -0400 Message-ID: <85d15rvxze.fsf@mojatatu.com> References: <1507816314-2896-1-git-send-email-mrv@mojatatu.com> Mime-Version: 1.0 Content-Type: text/plain Cc: David Ahern , David Miller , Stephen Hemminger , Linux Kernel Network Developers , Jamal Hadi Salim To: Nikolay Aleksandrov Return-path: Received: from mail-io0-f179.google.com ([209.85.223.179]:44738 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011AbdJMQA7 (ORCPT ); Fri, 13 Oct 2017 12:00:59 -0400 Received: by mail-io0-f179.google.com with SMTP id m16so9484319iod.1 for ; Fri, 13 Oct 2017 09:00:59 -0700 (PDT) In-Reply-To: (Nikolay Aleksandrov's message of "Thu, 12 Oct 2017 21:12:31 +0300") Sender: netdev-owner@vger.kernel.org List-ID: Nikolay Aleksandrov 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.