lkml.org 
[lkml]   [2004]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectInconsistency in sysfs behavior?
The following appears to be an inconsistency in the way sysfs behaves.  
Tell me what you think...

When a user process parks its CWD in a kobject's sysfs directory and then
the kobject is unregistered, of course the directory is forced to remain
in existence (albeit unlinked) because of the reference held by the
process. But it does not in turn hold a reference to the kobject; the
kobject will be deleted immediately if nothing else refers to it.

On the other hand, if a user process opens a sysfs attribute file and then
sysfs_remove_file() is called, again the file is forced to remain in
existence (albeit unlinked) because of the reference held by the process.
But now it _does_ hold a reference to the kobject; if the kobject is
unregistered it will not be deleted until the user process closes the
attribute file.

Why this non-parallel behavior?

Alan Stern

-
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: 2005-03-22 13:59    [W:0.066 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site