linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Inconsistency in sysfs behavior?
@ 2004-01-07 15:48 Alan Stern
  2004-01-07 17:27 ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Stern @ 2004-01-07 15:48 UTC (permalink / raw)
  To: Greg KH, Patrick Mochel; +Cc: Kernel development list

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


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

end of thread, other threads:[~2004-01-09  4:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07 15:48 Inconsistency in sysfs behavior? Alan Stern
2004-01-07 17:27 ` Greg KH
2004-01-07 21:50   ` Alan Stern
2004-01-07 21:56     ` Greg KH
2004-01-07 22:24       ` Alan Stern
2004-01-07 22:34         ` Greg KH
2004-01-08 10:32   ` Maneesh Soni
2004-01-08 20:19     ` Greg KH
2004-01-09  4:56       ` Maneesh Soni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).