public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Maneesh Soni <maneesh@in.ibm.com>
Cc: linux-kernel@vger.kernel.org, Patrick Mochel <mochel@digitalimplant.org>
Subject: problem with duplicate sysfs directories and files
Date: Tue, 7 Mar 2006 23:53:42 -0800	[thread overview]
Message-ID: <20060308075342.GA17718@kroah.com> (raw)

Hi,

I spent some time tonight trying to track down how to fix the issue of
duplicate sysfs files and/or directories.  This happens when you try to
create a kobject with the same name in the same directory.  The creation
of the second kobject will fail, but the directory will remain in sysfs.

Now I know this isn't a normal operation, but it would be good to fix
this eventually.  I traced the issue down to fs/sysfs/dir.c:create_dir()
and the check for:
	if (error && (error != -EEXIST)) {

Problem is, error is set to -EEXIST, so we don't clean up properly.  Now
I know we can't just not check for this, as if you do that error
cleanup, the original kobject's sysfs entry gets very messed up (ls -l
does not like it at all...)

But I can't seem to figure out what exactly we need to do to clean up
properly here.

Do you, or anyone else, have any pointers or ideas?

thanks,

greg k-h

             reply	other threads:[~2006-03-08  7:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-08  7:53 Greg KH [this message]
2006-03-08  9:02 ` problem with duplicate sysfs directories and files Andrew Morton
2006-03-09  1:03   ` Greg KH
2006-03-09  2:58 ` Maneesh Soni
2006-03-09  5:58   ` Greg KH
2006-03-09 14:10     ` Maneesh Soni
2006-03-10  0:13       ` Greg KH

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=20060308075342.GA17718@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.com \
    --cc=mochel@digitalimplant.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox