Thread (12 messages) flat view 12 messages, 3 authors, 2016-06-15

Re: [PATCH net] net_sched: prio: rollback allocations if prio_init() fails

From: Eric Dumazet <hidden>
Date: 2016-06-13 17:13:26

On Mon, 2016-06-13 at 09:28 -0700, Cong Wang wrote:
On Sun, Jun 12, 2016 at 10:03 PM, Eric Dumazet [off-list ref] wrote:
quoted
From: Eric Dumazet <edumazet@google.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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help