[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1465838004.7945.167.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Mon, 13 Jun 2016 10:13:24 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net] net_sched: prio: rollback allocations if
prio_init() fails
On Mon, 2016-06-13 at 09:28 -0700, Cong Wang wrote:
> On Sun, Jun 12, 2016 at 10:03 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> > From: Eric Dumazet <edumazet@...gle.com>
> >
> > Now prio_init() can return -ENOMEM, it also has to make sure
> > any allocated qdisc are freed, since the caller (qdisc_create()) wont
> > call ->destroy() handler for us.
>
>
> But prio_tune() is called by ->change() too, so just call prio_destroy()
> inside prio_tune() ?
Because the following should work :
tc qdisc replace dev eth0 root prio bands 3
(later...)
tc qdisc change dev eth0 root prio bands 5 // memory allocation failure
We must not destroy the qdisc on a change operation if it fails.
Only the init should clean the qdisc state/memory/children since qdisc
wont be created for real.
Presumably we should commit changes on qdisc only if the whole
->change() succeeded, but I guess lot of qdisc are buggy in this
respect.
Powered by blists - more mailing lists