From: Alexey Dobriyan <adobriyan@sw.ru>
To: Holger Kiehl <Holger.Kiehl@dwd.de>
Cc: linux-kernel@vger.kernel.org, dhaval@linux.vnet.ibm.com,
vatsa@linux.vnet.ibm.com, mingo@elte.hu
Subject: Re: sysfs: duplicate filename '74' can not be created
Date: Tue, 4 Mar 2008 19:09:40 +0300 [thread overview]
Message-ID: <20080304160940.GC19059@localhost.sw.ru> (raw)
[Cc'ing /sys/kernel/uids guys]
> Mar 3 13:50:01 helena kernel: sysfs: duplicate filename '74' can not be created
> Mar 3 13:50:01 helena kernel: WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
> Mar 3 13:50:01 helena kernel: Pid: 21911, comm: sshd Not tainted 2.6.24.3 #1
I see only one suspicious place: KOBJ_ADD is sent even if sysfs file
creation failed and kobject is happily removed. But this almost
certainly separate bug.
You can try this debugging patch. Post several first consecutive messages.
[crosses fingers]
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -179,8 +179,11 @@ static int user_kobject_create(struct user_struct *up)
goto done;
error = sysfs_create_file(kobj, &up->user_attr.attr);
- if (error)
+ if (error) {
+ printk("%s: %p->uid = %d\n", __func__, up, up->uid);
+ WARN_ON(1);
kobject_del(kobj);
+ }
kobject_uevent(kobj, KOBJ_ADD);
@@ -363,6 +366,7 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
}
if (sched_create_user(new) < 0) {
+ WARN_ON(1);
key_put(new->uid_keyring);
key_put(new->session_keyring);
kmem_cache_free(uid_cachep, new);
@@ -371,6 +375,7 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
}
if (user_kobject_create(new)) {
+ WARN_ON(1);
sched_destroy_user(new);
key_put(new->uid_keyring);
key_put(new->session_keyring);
@@ -386,6 +391,10 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
spin_lock_irq(&uidhash_lock);
up = uid_hash_find(uid, hashent);
if (up) {
+#ifdef CONFIG_FAIR_USER_SCHED
+ printk("%s: %p->uid = %d\n", __func__, up, up->uid);
+ WARN_ON(1);
+#endif
/* This case is not possible when CONFIG_FAIR_USER_SCHED
* is defined, since we serialize alloc_uid() using
* uids_mutex. Hence no need to call
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 7af90fc..3479c55 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -32,6 +32,8 @@ static struct user_namespace *clone_user_ns(struct user_namespace *old_ns)
struct user_struct *new_user;
int n;
+ printk("%s: ENTER\n", __func__);
+
ns = kmalloc(sizeof(struct user_namespace), GFP_KERNEL);
if (!ns)
return ERR_PTR(-ENOMEM);
next reply other threads:[~2008-03-04 16:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 16:09 Alexey Dobriyan [this message]
2008-03-04 16:33 ` sysfs: duplicate filename '74' can not be created Dhaval Giani
2008-03-04 19:24 ` Greg KH
2008-03-05 8:59 ` Dhaval Giani
2008-03-06 6:00 ` Greg KH
2008-03-06 9:15 ` Alexey Dobriyan
2008-03-07 7:32 ` Holger Kiehl
2008-03-07 7:24 ` Holger Kiehl
2008-03-07 7:56 ` Holger Kiehl
2008-03-13 7:33 ` Holger Kiehl
-- strict thread matches above, loose matches on Subject: below --
2008-03-03 14:58 Holger Kiehl
2008-03-03 15:50 ` Alexey Dobriyan
2008-03-03 16:05 ` Holger Kiehl
2008-03-03 16:14 ` Holger Kiehl
2008-03-03 16:17 ` Alexey Dobriyan
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=20080304160940.GC19059@localhost.sw.ru \
--to=adobriyan@sw.ru \
--cc=Holger.Kiehl@dwd.de \
--cc=dhaval@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=vatsa@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox