All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "Américo Wang" <xiyou.wangcong@gmail.com>,
	"Kernel development list" <linux-kernel@vger.kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: sysfs lockdep complaint
Date: Sat, 20 Feb 2010 23:16:13 +0800	[thread overview]
Message-ID: <20100220151613.GH3000@hack> (raw)
In-Reply-To: <1266674291.18465.7.camel@jlt3.sipsolutions.net>

On Sat, Feb 20, 2010 at 02:58:11PM +0100, Johannes Berg wrote:
>On Sat, 2010-02-20 at 21:51 +0800, Américo Wang wrote:
>
>> >BUG: key c0000002165eb478 not in .data!
>> >
>> >instead of the lockdep complaint above.
>> >
>> 
>> I am not surprised. :)
>> 
>> Please send us the backtraces you got, we could expect this.
>
>I hacked in dump_stack() but it overflowed my log buffer, here's an example:
>
>[   31.625411] BUG: key c0000002134f2ab0 not in .data!
>[   31.625414] Call Trace:
>[   31.625417] [c000000213b677c0] [c000000000012c1c] .show_stack+0xc0/0x200 (unreliable)
>[   31.625423] [c000000213b67890] [c0000000005ac968] .dump_stack+0x28/0x3c
>[   31.625428] [c000000213b67910] [c0000000000b6a3c] .lockdep_init_map+0x11c/0x674
>[   31.625433] [c000000213b67a10] [c0000000001efd90] .sysfs_add_file_mode+0x90/0x124
>[   31.625438] [c000000213b67ad0] [c0000000001efe60] .sysfs_add_file+0x3c/0x50
>[   31.625442] [c000000213b67b70] [c0000000001f2f40] .sysfs_create_bin_file+0x5c/0x78
>[   31.625448] [c000000213b67c10] [c0000000000cd0b0] .load_module+0x16a4/0x197c
>[   31.625452] [c000000213b67d80] [c0000000000cd424] .SyS_init_module+0x9c/0x2d4
>[   31.625457] [c000000213b67e30] [c0000000000075d4] syscall_exit+0x0/0x40
>
>There's also
>[   34.776604] BUG: key c000000216265388 not in .data!
>[   34.776606] Call Trace:
>[   34.776609] [c000000213b5f7a0] [c000000000012c1c] .show_stack+0xc0/0x200 (unreliable)
>[   34.776615] [c000000213b5f870] [c0000000005ac968] .dump_stack+0x28/0x3c
>[   34.776620] [c000000213b5f8f0] [c0000000000b6a3c] .lockdep_init_map+0x11c/0x674
>[   34.776624] [c000000213b5f9f0] [c0000000001efd90] .sysfs_add_file_mode+0x90/0x124
>[   34.776629] [c000000213b5fab0] [c0000000001f32b4] .internal_create_group+0x168/0x24c
>[   34.776634] [c000000213b5fb70] [c0000000001f3420] .sysfs_create_group+0x38/0x50
>[   34.776639] [c000000213b5fc10] [c0000000000ccf20] .load_module+0x1514/0x197c
>[   34.776644] [c000000213b5fd80] [c0000000000cd424] .SyS_init_module+0x9c/0x2d4
>[   34.776649] [c000000213b5fe30] [c0000000000075d4] syscall_exit+0x0/0x40
>

Thanks!

This could be fixed by the following.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---
diff --git a/kernel/module.c b/kernel/module.c
index f82386b..fa4d562 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1085,6 +1085,7 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
 		sect_attrs->nsections++;
 		sattr->mattr.show = module_sect_show;
 		sattr->mattr.store = NULL;
+		sysfs_attr_init(&sattr->mattr.attr);
 		sattr->mattr.attr.name = sattr->name;
 		sattr->mattr.attr.mode = S_IRUGO;
 		*(gattr++) = &(sattr++)->mattr.attr;
@@ -1178,6 +1179,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect,
 		if (sect_empty(&sechdrs[i]))
 			continue;
 		if (sechdrs[i].sh_type == SHT_NOTE) {
+			sysfs_bin_attr_init(nattr);
 			nattr->attr.name = mod->sect_attrs->attrs[loaded].name;
 			nattr->attr.mode = S_IRUGO;
 			nattr->size = sechdrs[i].sh_size;


  reply	other threads:[~2010-02-20 15:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18  9:32 sysfs lockdep complaint Johannes Berg
2010-02-20  9:26 ` Américo Wang
2010-02-20 11:13   ` Johannes Berg
2010-02-20 13:54     ` Américo Wang
2010-02-20 14:00       ` Johannes Berg
2010-02-20 11:20   ` Johannes Berg
2010-02-20 13:51     ` Américo Wang
2010-02-20 13:58       ` Johannes Berg
2010-02-20 15:16         ` Américo Wang [this message]
2010-02-20 14:01       ` Johannes Berg
2010-02-20 15:03         ` Américo Wang
2010-02-20 15:07           ` Johannes Berg
2010-02-20 15:08           ` Johannes Berg
2010-02-20 15:20             ` Américo Wang
2010-02-20 15:28               ` Johannes Berg
2010-02-20 15:31                 ` Johannes Berg
2010-02-20 15:44                   ` Américo Wang
2010-02-20 15:44                     ` Johannes Berg
2010-02-20 15:40                 ` Américo Wang
2010-02-20 15:41                   ` [PATCH] module: init sysfs attributes Johannes Berg
2010-02-20 15:43                   ` [PATCH] windfarm: " Johannes Berg
2010-02-24  2:49                     ` Benjamin Herrenschmidt
2010-02-24  7:32                       ` Johannes Berg
2010-02-24  7:34                         ` Américo Wang
2010-02-24  9:12                           ` Johannes Berg
2010-02-25  1:43                             ` Américo Wang
2010-03-08  7:46                               ` Johannes Berg
2010-02-24 13:24                           ` Greg KH
2010-02-25  1:46                             ` Américo Wang
2010-02-20 15:14           ` sysfs lockdep complaint Johannes Berg
2010-02-20 15:31             ` Américo Wang

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=20100220151613.GH3000@hack \
    --to=xiyou.wangcong@gmail.com \
    --cc=ebiederm@xmission.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.