Re: [PATCH 2/2] module: fix bne2 "gave up waiting for init ofmodule libcrc32c"

From: Brandon Philips
Date: Tue Jun 01 2010 - 19:27:48 EST


On 10:53 Tue 01 Jun 2010, Linus Torvalds wrote:
> On Tue, 1 Jun 2010, Linus Torvalds wrote:
> > So I do agree that your later two-patch series is the way to go.
>
> Oh, btw, did we ever get that version tested by the only person who seems
> to see the problem? Brandon?

Sorry for the delay. I broke the fuse on the remote power switch I was
using.

This is the subset of patches that everyone agreed, right?
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6 modules
Otherwise what patches should I be applying to 2.6.35-rc1?

When I tested a Kernel with Rusty's modules branch pulled onto
2.6.35-rc1 I got duplicate sysfs path errors:

[ 8.985303] WARNING: at fs/sysfs/dir.c:451 sysfs_add_one+0xb2/0xd0()
[ 8.998161] Hardware name: Dinar
[ 9.004734] sysfs: cannot create duplicate filename '/module/libcrc32c'
[ 9.018068] Modules linked in: libcrc32c(+) button ohci_hcd
ehci_hcd usbcore sd_mod crc_t10dif edd ext3 mbcache jbd fan thermal
processor thermal_sys hwmon ide_pci_generic atiixp ide_core
ata_generic ahci libahci pata_atiixp libata scsi_mod
[ 9.062682] Pid: 1588, comm: modprobe Not tainted 2.6.35-rc1-0.7-default #3
[ 9.076711] Call Trace:
[ 9.081731] [<ffffffff8116a162>] ? sysfs_add_one+0xb2/0xd0
[ 9.092988] [<ffffffff8104f6aa>] warn_slowpath_common+0x7a/0xd0
[ 9.105115] [<ffffffff8104f7a1>] warn_slowpath_fmt+0x41/0x50
[ 9.116718] [<ffffffff8116a162>] sysfs_add_one+0xb2/0xd0
[ 9.127628] [<ffffffff8116ace5>] create_dir+0x75/0xc0
[ 9.138015] [<ffffffff8116adc6>] sysfs_create_dir+0x96/0xc0
[ 9.149447] [<ffffffff811c5297>] kobject_add_internal+0xe7/0x250
[ 9.161744] [<ffffffff811c5518>] kobject_add_varg+0x38/0x60
[ 9.173173] [<ffffffff811c5593>] kobject_init_and_add+0x53/0x70
[ 9.185295] [<ffffffff811c5160>] ? kset_find_obj+0x40/0x90
[ 9.196555] [<ffffffff8107f193>] mod_sysfs_init+0x83/0xf0
[ 9.207639] [<ffffffff810807ec>] load_module+0xbec/0x1e10
[ 9.218723] [<ffffffff810d7467>] ? handle_mm_fault+0x227/0xaf0
[ 9.230672] [<ffffffff810da47c>] ? vma_link+0xac/0x110
[ 9.241236] [<ffffffff81385168>] ? do_page_fault+0x228/0x410
[ 9.252839] [<ffffffff810dcc19>] ? do_mmap_pgoff+0x359/0x380
[ 9.264442] [<ffffffff81081a6a>] sys_init_module+0x5a/0x220
[ 9.275873] [<ffffffff81002ec2>] system_call_fastpath+0x16/0x1b
[ 9.287993] ---[ end trace 2a73785cc061234f ]---
[ 9.297350] kobject_add_internal failed for libcrc32c with -EEXIST,
don't try to register things with the same name in the same directory.

To fix this we need to make sure that we only have one copy of a module
going through load_module at a time. Patch suggestion follows which
boots without errors. I am sure there is a better way to do what it does
;)

Full dmesg:
http://ifup.org/~philips/rusty-module-branch.dmesg

Cheers,

Brandon