lkml.org 
[lkml]   [2006]   [Mar]   [8]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 8 Mar 2006 01:02:05 -0800
FromAndrew Morton <>
SubjectRe: problem with duplicate sysfs directories and files
Greg KH <greg@kroah.com> wrote:
>
> 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?
> 

Emit a loud warning and don't bother cleaning up - leave the current
behaviour as-is.  Whatever takes the least amount code and has the minimum
end-user impact, IMO.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-08 09:06    [from the cache]
©2003-2008