public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6.0-test6 module autoloading and reference counting broken?
@ 2003-10-03 12:30 Mikael Pettersson
  2003-10-10  5:25 ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael Pettersson @ 2003-10-03 12:30 UTC (permalink / raw)
  To: linux-kernel, rusty

FYI,

I'm seeing incorrect reference counting behaviour and module
loading semi-failures in 2.6.0-test6.

I have a misc char driver module which announces an alias
via a MODULE_ALIAS("char-major-10-<nnn>") declaration.

The first attempt by user-space to open the device node fails
with ENODEV. However, afterwards the module _is_ loaded and its
use count is 1 even though the user-space open() failed.

Subsequent open()s succeed, but since the reference count is
one too high, I can't unload the module.

If I instead manually insmod or modprobe the module before the
first device node open(), the module's use count is correct and
I can unload it after the last open()ed file goes away.

CONFIG_KMOD is set, module-init-tools is 0.9.14.

I'll keep digging...

/Mikael

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 2.6.0-test6 module autoloading and reference counting broken?
  2003-10-03 12:30 2.6.0-test6 module autoloading and reference counting broken? Mikael Pettersson
@ 2003-10-10  5:25 ` Rusty Russell
  0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2003-10-10  5:25 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: linux-kernel

In message <16253.27644.578089.345998@gargle.gargle.HOWL> you write:
> FYI,
> 
> I'm seeing incorrect reference counting behaviour and module
> loading semi-failures in 2.6.0-test6.
> 
> I have a misc char driver module which announces an alias
> via a MODULE_ALIAS("char-major-10-<nnn>") declaration.
> 
> The first attempt by user-space to open the device node fails
> with ENODEV. However, afterwards the module _is_ loaded and its
> use count is 1 even though the user-space open() failed.

Sounds like a refcount bug somewhere (in your module, maybe?).
There's nothing magic about modules loaded via kmod, even via
aliases, unless there's a bug in drivers/char/misc.c...

Puzzled,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 2.6.0-test6 module autoloading and reference counting broken?
@ 2003-10-11  9:56 Mikael Pettersson
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael Pettersson @ 2003-10-11  9:56 UTC (permalink / raw)
  To: rusty; +Cc: linux-kernel

On Fri, 10 Oct 2003 15:25:20 +1000, Rusty Russell wrote:
>In message <16253.27644.578089.345998@gargle.gargle.HOWL> you write:
>> FYI,
>> 
>> I'm seeing incorrect reference counting behaviour and module
>> loading semi-failures in 2.6.0-test6.
>> 
>> I have a misc char driver module which announces an alias
>> via a MODULE_ALIAS("char-major-10-<nnn>") declaration.
>> 
>> The first attempt by user-space to open the device node fails
>> with ENODEV. However, afterwards the module _is_ loaded and its
>> use count is 1 even though the user-space open() failed.
>
>Sounds like a refcount bug somewhere (in your module, maybe?).
>There's nothing magic about modules loaded via kmod, even via
>aliases, unless there's a bug in drivers/char/misc.c...

test6 did introduce a bug in drivers/char/misc.c causing
the problems I described. It's been fixed in test7.

/Mikael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-11  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-03 12:30 2.6.0-test6 module autoloading and reference counting broken? Mikael Pettersson
2003-10-10  5:25 ` Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2003-10-11  9:56 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox