Skip to contentSkip to conversation

2.6.0-test6 module autoloading and reference counting broken?

DISCUSSION Mikael Pettersson 2 participants 2 messages Oct 3, 2003 – Oct 10, 2003

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

In message <[email protected]> you write:

Quoted 11 lines

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.