public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* problem with duplicate sysfs directories and files
@ 2006-03-08  7:53 Greg KH
  2006-03-08  9:02 ` Andrew Morton
  2006-03-09  2:58 ` Maneesh Soni
  0 siblings, 2 replies; 7+ messages in thread
From: Greg KH @ 2006-03-08  7:53 UTC (permalink / raw)
  To: Maneesh Soni; +Cc: linux-kernel, Patrick Mochel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-03-10  0:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-08  7:53 problem with duplicate sysfs directories and files Greg KH
2006-03-08  9:02 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox