From: John Fastabend <john.fastabend@gmail.com>
To: xiyou.wangcong@gmail.com, wang.bo116@zte.com.cn
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, john.r.fastabend@intel.com,
edumazet@google.com, kaber@trash.net, vtlam@google.com
Subject: Re: [Patch net 2/2] net_sched: always call ->destroy when ->init() fails
Date: Wed, 29 Oct 2014 20:09:02 -0700 [thread overview]
Message-ID: <5451ABCE.90504@gmail.com> (raw)
In-Reply-To: <20141029.142934.1722309776700951536.davem@davemloft.net>
On 10/29/2014 11:29 AM, David Miller wrote:
> From: Cong Wang <xiyou.wangcong@gmail.com>
> Date: Fri, 24 Oct 2014 16:55:59 -0700
>
>> In qdisc_create(), when ->init() exists and it fails, we should
>> call ->destroy() to clean up the potentially partially initialized
>> qdisc's. This will also make the ->init() implementation easier.
>>
>> qdisc_create_dflt() already does that. Most callers of qdisc_create_dflt()
>> simply use noop_qdisc when it fails.
>>
>> And, most of the ->destroy() implementations are already able to clean up
>> partially initialization, we don't need to worry.
>>
>> The following ->init()'s need to catch up:
>> fq_codel_init(), hhf_init(), multiq_init(), sfq_init(), mq_init(),
>> mqprio_init().
>>
>> Reported-by: Wang Bo <wang.bo116@zte.com.cn>
>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>
> As discussed, I really want to see ->init() clean up it's own crap.
>
> There are certain kinds of initializations that cannot be tested for,
> such as setting up a workqueue etc.
>
> Therefore, the mere idea that we can call ->destroy() to handle this
> is a pure non-starter as far as I am concerned.
>
> Thanks.
> --
Cong/Wang, anyone working on this? Otherwise I'll take a stab
at it tomorrow.
Thanks!
John
--
John Fastabend Intel Corporation
next prev parent reply other threads:[~2014-10-30 3:09 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
2014-10-28 19:58 ` David Miller
2014-10-29 18:29 ` David Miller
2014-10-30 3:09 ` John Fastabend [this message]
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=5451ABCE.90504@gmail.com \
--to=john.fastabend@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=john.r.fastabend@intel.com \
--cc=kaber@trash.net \
--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;
as well as URLs for NNTP newsgroup(s).