From: Lucas De Marchi <lucas.de.marchi@gmail.com> To: Harish Jenny Kandiga Nagaraj <harish_kandiga@mentor.com> Cc: Rusty Russell <rusty@rustcorp.com.au>, linux-modules <linux-modules@vger.kernel.org>, lkml <linux-kernel@vger.kernel.org>, greg KH <gregkh@linuxfoundation.org> Subject: Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN Date: Thu, 19 Feb 2015 08:30:40 -0200 [thread overview] Message-ID: <CAKi4VA+ceEsQm30+4q_hvgtm2Uwo1cJSQdJErUh6hsd=fwbe0g@mail.gmail.com> (raw) In-Reply-To: <54E5795C.5050804@mentor.com> On Thu, Feb 19, 2015 at 3:49 AM, Harish Jenny Kandiga Nagaraj <harish_kandiga@mentor.com> wrote: >> Harrish, in your patch if you just change the "return >> KMOD_MODULE_BUILTIN;" to "return KMOD_MODULE_COMING;" does it work? > > Yes. Returning KMOD_MODULE_COMING instead of KMOD_MODULE_BUILTIN works. = The built-in modules are handled by looking at the modules.builtin index fi= le. Is there any chance of returning KMOD_MODULE_COMING for builti-in modul= es? If it does not have any impact, then the fix should be fine. well... you're not returning KMOD_MODULE_COMING for a builtin module. Having the directory /sys/module/<name> and not the initstate could be either that the module is builtin or that there's a race while loading the module and it's in the coming state. However since we use the index to decide if this module is builtin in the beginning of this function, here it can only be the second case. However... mod->builtin in the beginning of this function is only set if the module is created by a lookup rather than from name or from path.... maybe here we need to actually fallback to the index rather than the cached value, otherwise this test would fail (considering "vt" is builtin): kmod_module_new_from_name(ctx, "vt", &mod); kmod_module_get_initstate(mod, &state); > Do I need to send a separate patch ? I was hoping it would be a oneliner, but it isn't. If you are going to send a patch, please add the necessary checks for the builtin index. Otherwise I can take a look on this until the end of this week. --=20 Lucas De Marchi
WARNING: multiple messages have this Message-ID (diff)
From: Lucas De Marchi <lucas.de.marchi@gmail.com> To: Harish Jenny Kandiga Nagaraj <harish_kandiga@mentor.com> Cc: Rusty Russell <rusty@rustcorp.com.au>, linux-modules <linux-modules@vger.kernel.org>, lkml <linux-kernel@vger.kernel.org>, greg KH <gregkh@linuxfoundation.org> Subject: Re: [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN Date: Thu, 19 Feb 2015 08:30:40 -0200 [thread overview] Message-ID: <CAKi4VA+ceEsQm30+4q_hvgtm2Uwo1cJSQdJErUh6hsd=fwbe0g@mail.gmail.com> (raw) In-Reply-To: <54E5795C.5050804@mentor.com> On Thu, Feb 19, 2015 at 3:49 AM, Harish Jenny Kandiga Nagaraj <harish_kandiga@mentor.com> wrote: >> Harrish, in your patch if you just change the "return >> KMOD_MODULE_BUILTIN;" to "return KMOD_MODULE_COMING;" does it work? > > Yes. Returning KMOD_MODULE_COMING instead of KMOD_MODULE_BUILTIN works. The built-in modules are handled by looking at the modules.builtin index file. Is there any chance of returning KMOD_MODULE_COMING for builti-in modules? If it does not have any impact, then the fix should be fine. well... you're not returning KMOD_MODULE_COMING for a builtin module. Having the directory /sys/module/<name> and not the initstate could be either that the module is builtin or that there's a race while loading the module and it's in the coming state. However since we use the index to decide if this module is builtin in the beginning of this function, here it can only be the second case. However... mod->builtin in the beginning of this function is only set if the module is created by a lookup rather than from name or from path.... maybe here we need to actually fallback to the index rather than the cached value, otherwise this test would fail (considering "vt" is builtin): kmod_module_new_from_name(ctx, "vt", &mod); kmod_module_get_initstate(mod, &state); > Do I need to send a separate patch ? I was hoping it would be a oneliner, but it isn't. If you are going to send a patch, please add the necessary checks for the builtin index. Otherwise I can take a look on this until the end of this week. -- Lucas De Marchi
next prev parent reply other threads:[~2015-02-19 10:30 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-02-17 12:56 [PATCH] libkmod-module: Remove directory existence check for KMOD_MODULE_BUILTIN Harish Jenny K N 2015-02-17 17:30 ` Lucas De Marchi 2015-02-18 4:07 ` Rusty Russell 2015-02-18 6:10 ` Harish Jenny Kandiga Nagaraj 2015-02-18 16:50 ` Lucas De Marchi 2015-02-18 22:40 ` Rusty Russell 2015-02-19 1:19 ` Lucas De Marchi 2015-02-19 2:25 ` greg KH 2015-02-19 3:46 ` Lucas De Marchi 2015-02-19 2:25 ` Rusty Russell 2015-02-19 3:34 ` Lucas De Marchi 2015-02-19 5:49 ` Harish Jenny Kandiga Nagaraj 2015-02-19 10:30 ` Lucas De Marchi [this message] 2015-02-19 10:30 ` Lucas De Marchi 2015-02-19 12:32 ` Harish Jenny Kandiga Nagaraj 2015-02-19 12:43 ` Lucas De Marchi 2015-02-19 12:43 ` Lucas De Marchi 2015-02-19 14:02 ` Harish Jenny Kandiga Nagaraj 2015-02-19 14:35 ` Harish Jenny Kandiga Nagaraj 2015-02-28 17:28 ` Lucas De Marchi 2015-03-02 4:52 ` Harish Jenny Kandiga Nagaraj 2015-02-19 12:33 ` Harish Jenny Kandiga Nagaraj
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='CAKi4VA+ceEsQm30+4q_hvgtm2Uwo1cJSQdJErUh6hsd=fwbe0g@mail.gmail.com' \ --to=lucas.de.marchi@gmail.com \ --cc=gregkh@linuxfoundation.org \ --cc=harish_kandiga@mentor.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-modules@vger.kernel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.