linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@profusion.mobi>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Jon Masters <jonathan@jonmasters.org>,
	linux-modules <linux-modules@vger.kernel.org>,
	Lucas De Marchi <lucas.de.marchi@gmail.com>
Subject: Re: [PATCH 2/2] module: wait when loading a module which is currently initializing.
Date: Mon, 17 Sep 2012 14:37:23 -0300	[thread overview]
Message-ID: <CAMOw1v6NE_CS63kCsfQ=kO8GdPpMzUi1+oyP97oq_DnV39ex1g@mail.gmail.com> (raw)
In-Reply-To: <878vc9s1tr.fsf@rustcorp.com.au>

On Mon, Sep 17, 2012 at 1:36 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> Lucas De Marchi <lucas.demarchi@profusion.mobi> writes:
>>> -       if (find_module(mod->name)) {
>>> +       if ((old = find_module(mod->name)) != NULL) {
>>> +               if (old->state == MODULE_STATE_COMING) {
>>> +                       /* Wait in case it fails to load. */
>>> +                       mutex_unlock(&module_mutex);
>>> +                       err = wait_event_interruptible(module_wq,
>>> +                                              finished_loading(mod->name));
>>> +                       if (err)
>>> +                               goto free_arch_cleanup;
>>> +                       goto again;
>>
>> I wonder if we should indeed retry in case the module failed to load
>> or if we should just skip straight to returning the error code. We
>> don't have the return code for the failed load, but maybe we can
>> fabricate one here.
>>
>> Thoughts?
>
> Could have different cmdline parameters, or other randomness like
> out-of-memory.  I think this is safest.

makes sense. Ack.

Lucas De Marchi

  reply	other threads:[~2012-09-17 17:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14  7:09 [PATCH 1/2] module: fix symbol waiting when module fails before init Rusty Russell
2012-09-14  7:11 ` [PATCH 2/2] module: wait when loading a module which is currently initializing Rusty Russell
2012-09-14 16:37   ` Lucas De Marchi
2012-09-17  4:36     ` Rusty Russell
2012-09-17 17:37       ` Lucas De Marchi [this message]
2012-09-14  7:12 ` module: test code for waiting Rusty Russell
2012-09-14 16:41 ` [PATCH 1/2] module: fix symbol waiting when module fails before init Lucas De Marchi

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='CAMOw1v6NE_CS63kCsfQ=kO8GdPpMzUi1+oyP97oq_DnV39ex1g@mail.gmail.com' \
    --to=lucas.demarchi@profusion.mobi \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).