[Bugme-janitors] [Bug 14703] New: parisc: Badness at fs/sysfs/dir.c:487

bugzilla-daemon at bugzilla.kernel.org bugzilla-daemon at bugzilla.kernel.org
Fri Nov 27 13:59:05 PST 2009


http://bugzilla.kernel.org/show_bug.cgi?id=14703

               URL: http://patchwork.kernel.org/patch/42190/
           Summary: parisc: Badness at fs/sysfs/dir.c:487
           Product: Other
           Version: 2.5
    Kernel Version: 2.6.32-rc8
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Modules
        AssignedTo: other_modules at kernel-bugs.osdl.org
        ReportedBy: deller at gmx.de
                CC: roland at redhat.com, rusty at rustcorp.com.au
        Regression: Yes


Created an attachment (id=23968)
 --> (http://bugzilla.kernel.org/attachment.cgi?id=23968)
[PATCH] modules: don't export section names of empty sections via sysfs

On the parisc architecture _every_ kernel module brings up a kernel "badness
warning" like the following one:

sysfs: cannot create duplicate filename '/module/ac97_bus/sections/.text'
------------[ cut here ]------------
Badness at fs/sysfs/dir.c:487

IASQ: 00000000 00000000 IAOQ: 10204ff8 10204ffc
 IIR: 03ffe01f    ISR: 00000000  IOR: 00000000
 CPU:        0   CR30: 7ce58000 CR31: 11111111
 ORIG_R28: 00000001
 IAOQ[0]: sysfs_add_one+0xb8/0xd0
 IAOQ[1]: sysfs_add_one+0xbc/0xd0
 RP(r2): sysfs_add_one+0xb8/0xd0
Backtrace:
 [<102045b8>] sysfs_add_file_mode+0x60/0xc4
 [<1020748c>] internal_create_group+0xf0/0x1d8
 [<1016f0f0>] load_module+0x10e8/0x1294 

Reason for that is, that on parisc we do have kernel modules 
with duplicate section names, e.g. multiple ".text" sections.

An objdump on such a kernel module gives:
Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .note.gnu.build-id 00000024  00000000  00000000  00000034  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA            
  1 .text         00000000  00000000  00000000  00000058  2**0     
                  CONTENTS, ALLOC, LOAD, READONLY, CODE            
  2 .text.ac97_bus_match 0000001c  00000000  00000000  00000058  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE              
  3 .exit.text    00000030  00000000  00000000  00000074  2**2       
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE       
  4 .init.text    00000030  00000000  00000000  000000a4  2**2       
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE       
  5 .text         00000000  00000000  00000000  000000d4  2**0       
                  CONTENTS, ALLOC, LOAD, READONLY, CODE              
  6 .rodata.str1.4 00000008  00000000  00000000  000000d4  2**2      
                  CONTENTS, ALLOC, LOAD, READONLY, DATA              
...
As you can see, two ".text" sections are listed (due to usage
of the -ffunction-sections compiler flag which is needed on parisc).

Interestingly the .text sections are empty (size of 0 bytes).
Since there is no need to load sections which are 0 bytes long,
I don't see a reason, why such sections need to be listed
under /sys/module/<module_name>/sections/<section_name> either.

The attached patch does solve this issues for parisc by just don't
exporting section names which are empty (size of 0 bytes).

Helge

-- 
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.


More information about the Bugme-janitors mailing list