From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: Steven Rostedt <rostedt@goodmis.org>,
"Qiu, PeiyangX" <peiyangx.qiu@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>,
Rusty Russell <rusty@rustcorp.com.au>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] module: deal with the failure of complete_formation
Date: Wed, 06 Jan 2016 09:14:42 +0800 [thread overview]
Message-ID: <568C6A82.6090202@linux.intel.com> (raw)
In-Reply-To: <20160105200114.59fbf832@gandalf.local.home>
On 2016/1/6 9:01, Steven Rostedt wrote:
> On Fri, 25 Dec 2015 15:03:13 +0800
> "Qiu, PeiyangX" <peiyangx.qiu@intel.com> wrote:
>
>> From: Qiu Peiyang <peiyangx.qiu@intel.com>
>>
>> complete_formation might fail. kernel need clean up
>> ftrace records of the module.
>>
>> The patch fixes it by tuning the operation sequence in
>> complete_formation. After complete_formation checks
>> verify_export_symbols, call ftrace_module_init to init
>> ftrace records.
>>
>> Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
>> Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>
>> ---
>> kernel/module.c | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/kernel/module.c b/kernel/module.c
>> index 8f051a1..0a67c4e 100644
>> --- a/kernel/module.c
>> +++ b/kernel/module.c
>> @@ -3373,6 +3373,11 @@ static int complete_formation(struct module *mod, struct load_info *info)
>> /* This relies on module_mutex for list integrity. */
>> module_bug_finalize(info->hdr, info->sechdrs, mod);
>>
>> + mutex_unlock(&module_mutex);
>> +
> First of all, this is buggy. You can't just move the locking of
> module_mutex. That is needed to modify mod->state.
>
> Second of all, you are solving this wrong. I guess we should add
> ftrace_module_init_fail() function to cover the cases where the module
> can fail before calling do_init_module(), as if that happens it does
> not call the module going notifiers.
It's a good idea although ftrace_module_init_fail might be complicated.
Thanks,
Yanmin
next prev parent reply other threads:[~2016-01-06 1:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-25 6:22 [PATCH 0/2] fix ftrace initialization issue when a module is loaded Qiu, PeiyangX
2015-12-25 6:46 ` [PATCH 1/2] ftrace: fix the race between ftrace and insmod Qiu, PeiyangX
2015-12-25 7:03 ` Qiu, PeiyangX
2015-12-25 7:03 ` [PATCH 2/2] module: deal with the failure of complete_formation Qiu, PeiyangX
2016-01-06 1:01 ` Steven Rostedt
2016-01-06 1:14 ` Zhang, Yanmin [this message]
2016-01-06 1:29 ` Steven Rostedt
2016-01-06 1:48 ` Zhang, Yanmin
2016-01-06 1:53 ` Steven Rostedt
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=568C6A82.6090202@linux.intel.com \
--to=yanmin_zhang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peiyangx.qiu@intel.com \
--cc=rostedt@goodmis.org \
--cc=rusty@rustcorp.com.au \
/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
Powered by JetHome