All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Jan Glauber <jang@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Pavel Emelyanov <xemul@openvz.org>,
	Andi Kleen <andi@firstfloor.org>,
	Jon Masters <jonathan@jonmasters.org>
Subject: Re: [PATCH] module loader should not complain about unknown symbol
Date: Tue, 13 Nov 2007 09:23:12 +1100	[thread overview]
Message-ID: <200711130923.12616.rusty@rustcorp.com.au> (raw)
In-Reply-To: <1194877107.5656.31.camel@localhost.localdomain>

On Tuesday 13 November 2007 01:18:27 Jan Glauber wrote:
> If module A depends on module B and module B has not yet finished its
> init() the module loader may print a warning about an unknown symbol.
>
> This happens if module B is still in state MODULE_STATE_COMING,
> as module A runs into resolve_symbol() for a symbol from module B.
> resolve_symbol() return 0 in that case and causes the warning.

It also happens when a symbol is undefined, so this patch is a bad idea.

To do this properly you would change strong_try_module_get to return -EBUSY 
and -ENOENT, then change use_module(), then finally resolve_symbol(), then 
only print a warning when it returns something other than -EBUSY.

Better might be to put in a waitqueue and wake it up whenever a module is 
deleted or changes status.  Then use_module() can wait if 
strong_try_module_get() returns -EBUSY (up to 30 seconds, then print a 
warning and fail).

Hope that helps,
Rusty.

  parent reply	other threads:[~2007-11-12 22:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 14:18 [PATCH] module loader should not complain about unknown symbol Jan Glauber
2007-11-12 16:59 ` Andi Kleen
2007-11-12 22:23 ` Rusty Russell [this message]
2007-11-13  2:52   ` Rusty Russell
2007-11-13  4:08     ` Peter Teoh
2007-11-13  4:40       ` Rusty Russell
2007-11-13  4:55         ` Jon Masters
2007-11-14 12:12     ` Jan Glauber

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=200711130923.12616.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=andi@firstfloor.org \
    --cc=jang@linux.vnet.ibm.com \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xemul@openvz.org \
    /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 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.