All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
	Roman Mashak <mrv@mojatatu.com>, David Ahern <dsahern@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v2 1/1] bridge: return error code when deleting Vlan
Date: Thu, 12 Oct 2017 22:03:30 -0400	[thread overview]
Message-ID: <64292550-f043-c1f7-5b0e-004288832887@mojatatu.com> (raw)
In-Reply-To: <e4611694-4248-e796-5cca-24f3d07e0e9e@cumulusnetworks.com>

On 17-10-12 02:12 PM, Nikolay Aleksandrov wrote:
> On 12/10/17 21:07, Roman Mashak wrote:

>> 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.
> 

The issue is more subtle (per Roman above):
Try to delete a vlan (that doesnt  exist).
1) It says "success".
2) Worse: Another process listening (bridge monitor?) gets an _event_
  that  the vlan has been deleted (when it never existed in the first
  place).

> 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.
>

I think this is a bug (especially the event part).

cheers,
jamal

  reply	other threads:[~2017-10-13  2:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 13:51 [PATCH net-next v2 1/1] bridge: return error code when deleting Vlan Roman Mashak
2017-10-12 14:19 ` David Ahern
2017-10-12 18:07   ` Roman Mashak
2017-10-12 18:12     ` Nikolay Aleksandrov
2017-10-13  2:03       ` Jamal Hadi Salim [this message]
2017-10-13  2:15         ` Nikolay Aleksandrov
2017-10-13 14:31           ` David Ahern
2017-10-13 16:00       ` Roman Mashak
2017-10-14 10:52         ` Nikolay Aleksandrov

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=64292550-f043-c1f7-5b0e-004288832887@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=stephen@networkplumber.org \
    /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.