LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH 2/2] modules: Whine about suspicious return values from module's ->init() hook
Date: Thu, 6 Mar 2008 01:04:45 +0200	[thread overview]
Message-ID: <20080305230445.GB937@cs181133002.pp.htv.fi> (raw)
In-Reply-To: <200803042322.26693.rusty@rustcorp.com.au>

On Tue, Mar 04, 2008 at 11:22:26PM +1100, Rusty Russell wrote:
> Subject: Whine about suspicious return values from module's ->init() hook
> Date: Mon, 11 Feb 2008 01:09:06 +0300
> From: Alexey Dobriyan <adobriyan@gmail.com>
> 
> Return value convention of module's init functions is 0/-E. Sometimes, e.g.
> during forward-porting mistakes happen and buggy module created, where result
> of comparison "workqueue != NULL" is propagated all the way up to
> sys_init_module. What happens is that some other module created workqueue in
> question, our module created it again and module was successfully loaded.
> 
> Or it could be some other bug.
> 
> Let's make such mistakes much more visible. In retrospective, such messages
> would noticeably shorten some of my head-scratching sessions.
> 
> Note, that dump_stack() is just a way to get attention from user.
> Sample message:
> 
> sys_init_module: 'foo'->init suspiciously returned 1, it should follow 0/-E convention
> sys_init_module: loading module anyway...
>...

While I agree with Andrew that a BUG() would not be appropriate here I'm 
wondering why the module should be loaded?

We do know that something in the module is buggy.

And not loading the module also seems to be a good compromise between 
making the user notice the problem and not doing a panic().

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  reply	other threads:[~2008-03-05 23:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 12:21 [PATCH 1/2] modules: Fix module waiting for dependent modules' init Rusty Russell
2008-03-04 12:22 ` [PATCH 2/2] modules: Whine about suspicious return values from module's ->init() hook Rusty Russell
2008-03-05 23:04   ` Adrian Bunk [this message]
2008-03-06  0:32     ` Rusty Russell

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=20080305230445.GB937@cs181133002.pp.htv.fi \
    --to=bunk@kernel.org \
    --cc=adobriyan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --subject='Re: [PATCH 2/2] modules: Whine about suspicious return values from module'\''s ->init() hook' \
    /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

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).