[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpXRfHQ=Hzhon=ggjPJGjfS1CCkM6iV8oJ3iHZiTpnJFmw@mail.gmail.com>
Date: Fri, 2 Apr 2021 16:14:06 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Vlad Buslov <vladbu@...dia.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Kumar Kartikeya Dwivedi <memxor@...il.com>,
David Miller <davem@...emloft.net>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>,
Jakub Kicinski <kuba@...nel.org>,
Toke Høiland-Jørgensen <toke@...hat.com>
Subject: Re: [PATCH RFC 2/4] net: sched: fix err handler in tcf_action_init()
On Wed, Mar 31, 2021 at 9:41 AM Vlad Buslov <vladbu@...dia.com> wrote:
>
> With recent changes that separated action module load from action
> initialization tcf_action_init() function error handling code was modified
> to manually release the loaded modules if loading/initialization of any
> further action in same batch failed. For the case when all modules
> successfully loaded and some of the actions were initialized before one of
> them failed in init handler. In this case for all previous actions the
> module will be released twice by the error handler: First time by the loop
> that manually calls module_put() for all ops, and second time by the action
> destroy code that puts the module after destroying the action.
This is really strange. Isn't tc_action_load_ops() paired with module_put()
under 'err_mod'? And the one in tcf_action_destroy() paired with
tcf_action_init_1()? Is it the one below which causes the imbalance?
1038 /* module count goes up only when brand new policy is created
1039 * if it exists and is only bound to in a_o->init() then
1040 * ACT_P_CREATED is not returned (a zero is).
1041 */
1042 if (err != ACT_P_CREATED)
1043 module_put(a_o->owner);
1044
Thanks.
Powered by blists - more mailing lists