From: Patrick McHardy <kaber@trash.net>
To: Cong Wang <cwang@twopensource.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
netdev <netdev@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Wang Bo <wang.bo116@zte.com.cn>,
John Fastabend <john.r.fastabend@intel.com>,
Eric Dumazet <edumazet@google.com>, Terry Lam <vtlam@google.com>
Subject: Re: [Patch net 2/2] net_sched: always call ->destroy when ->init() fails
Date: Sat, 25 Oct 2014 02:04:00 +0100 [thread overview]
Message-ID: <20141025010359.GD11289@acer.localdomain> (raw)
In-Reply-To: <CAHA+R7NBr_K4fZ-nr2hi+isbxJt92D9o-q+n9xq5Y1rHv14F7Q@mail.gmail.com>
On Fri, Oct 24, 2014 at 05:53:33PM -0700, Cong Wang wrote:
> On Fri, Oct 24, 2014 at 5:44 PM, Patrick McHardy <kaber@trash.net> wrote:
> > On Fri, Oct 24, 2014 at 05:38:48PM -0700, Cong Wang wrote:
> >> On Fri, Oct 24, 2014 at 5:36 PM, Patrick McHardy <kaber@trash.net> wrote:
> >> >
> >> > Again, the correct fix is to make qdisc_create_dflt() not call
> >> > qdisc_destroy() but clean up the qdisc manually as done in
> >> > qdisc_create().
> >>
> >> I kindly wish you a good luck with fixing all callers of qdisc_create_dflt().
> >> Go ahead. :)
> >
> > Here you go:
> >
>
> ...
>
> Did you check all ->init() call ->destroy() on failure? Look at the
> sch_pie I have fixed in 1/2.
Why should they? They need to clean up internally, how they do it is
entirely up to them.
> Also check those xxx_init() calling xxx_change().
Please point to conrete bugs if you have any doubts. Real ones, not things
like qdisc_watchdog_init(). This is how the API to which the qdiscs have
been written has always worked.
And yes, I did check the qdisc error paths many times in the past.
> Really, we don't have to make all ->init() doing cleanup by itself.
Are you seriously suggesting that it would be better to have ->destroy()
check what parts were actually initialized and what needs to be cleaned
up instead of assuming a consistent state and have the only function that
actually knows the current state on error (->init()) do its own cleanup?
That's not even worth arguing about, its utterly and completely wrong.
next prev parent reply other threads:[~2014-10-25 1:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 23:55 [Patch net 1/2] sch_pie: schedule the timer after all init succeed Cong Wang
2014-10-24 23:55 ` [Patch net 2/2] net_sched: always call ->destroy when ->init() fails Cong Wang
2014-10-25 0:14 ` Eric Dumazet
2014-10-25 0:36 ` Cong Wang
2014-10-25 0:40 ` Eric Dumazet
2014-10-25 0:42 ` Eric Dumazet
2014-10-25 0:36 ` Patrick McHardy
2014-10-25 0:38 ` Cong Wang
2014-10-25 0:44 ` Patrick McHardy
2014-10-25 0:53 ` Cong Wang
2014-10-25 1:04 ` Patrick McHardy [this message]
2014-10-28 19:58 ` David Miller
2014-10-29 18:29 ` David Miller
2014-10-30 3:09 ` John Fastabend
2014-10-25 0:17 ` [Patch net 1/2] sch_pie: schedule the timer after all init succeed Eric Dumazet
2014-10-25 0:28 ` Cong Wang
2014-10-25 0:39 ` Eric Dumazet
2014-10-25 0:42 ` Cong Wang
2014-10-29 18:28 ` David Miller
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=20141025010359.GD11289@acer.localdomain \
--to=kaber@trash.net \
--cc=cwang@twopensource.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=john.r.fastabend@intel.com \
--cc=netdev@vger.kernel.org \
--cc=vtlam@google.com \
--cc=wang.bo116@zte.com.cn \
--cc=xiyou.wangcong@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox