[lkml]   [2009]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 25/20] sysfs: Only support removing emtpy sysfs directories.
On Wed, 27 May 2009, Eric W. Biederman wrote:

> Alan Stern <> writes:
> >
> > As fas as I know, they can't. Instead, they can cause the SCSI layer
> > to unregister a sysfs directory containing a child directory. :-)
> >
> > Basically, a user program can delay removal of the child (i.e., the
> > target) directory indefinitely, because currently the target isn't
> > unregistered when all its children are removed -- it's unregistered
> > when all its children are _released_.
> Ok. Is this opens of /dev/sda1 and the like that are being held open by
> userspace that are potentially causing problems?

Yes, plus any other mechanism for preventing a struct device's refcount
from going to 0.

> I think I have the fix to that...

The fix is to delete the target when its children are deleted, and not
wait until the children are released.

Alan Stern

 \ /
  Last update: 2009-05-27 23:41    [W:0.288 / U:33.444 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site