<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
>

  <channel rdf:about="http://lwn.net/headlines/36850/">
    <title>LWN: Comments on "Avoiding sysfs surprises"</title>
    <link>http://lwn.net/Articles/36850/</link>
    <description>
This is a special feed containing comments posted
to the individual LWN article titled &quot;Avoiding sysfs surprises&quot;.

    </description>

    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>2</syn:updateFrequency>
    <items>
      <rdf:Seq>
	<rdf:li resource="http://lwn.net/Articles/50932/rss" />
	<rdf:li resource="http://lwn.net/Articles/37346/rss" />
      
      </rdf:Seq>
    </items>

  </channel>
    <item rdf:about="http://lwn.net/Articles/50932/rss">
      <title>Avoiding sysfs surprises</title>
      <link>http://lwn.net/Articles/50932/rss</link>
      <dc:date>2003-09-25T14:58:40+00:00</dc:date>
      <dc:creator>stripes</dc:creator>
      <description>
      &lt;BLOCKQUOTE&gt;All seems well, except for the small problem of that user process.  By 
sitting in the directory, it maintains a reference there.  The open attribute file is yet another 
reference.  If the driver has truly cleaned up and freed the devices, the user process will be 
holding structures with pointers into freed memory.  An attempt to read the (already open) 
attribute file at this point is almost certain to crash the system. &lt;/BLOCKQUOTE&gt;

&lt;P&gt;There is another way this can be handled.  In BSD at least (and I assume Linux) &quot;umount 
-f&quot; forcibly unmounts a filesystem even when files are still open.  The open files handles 
have their in memory VNODEs replaced with VNODEs from the &quot;dead file system&quot; which 
returns an error for every attempt to use it except for close.  That is also done with tty/pttys 
that have hangup called for them, and some other places where file handles (or VNODE 
backed memory segments) become invalid (and there is a command line utility to revoke 
access in case there is a wee security lapse...).

&lt;P&gt;It is a useful concept, and a lot simpler then reference counting.  In a few cases &quot;more 
correct&quot; as well.  In this case, for things like hot plugable devices it seems like the right 
thing.  For other stuff that might show up on sysfs, maybe not (should a processes memory 
image stay around after the process is kill -9'ed just because a debugger has the image 
open via sysfs?).

      
      </description>
    </item>
    <item rdf:about="http://lwn.net/Articles/37346/rss">
      <title>Garbage collection</title>
      <link>http://lwn.net/Articles/37346/rss</link>
      <dc:date>2003-06-21T16:40:10+00:00</dc:date>
      <dc:creator>rwmj</dc:creator>
      <description>
      Looks like a good argument for garbage collection to me.&lt;p&gt;Rich.
      
      </description>
    </item>
</rdf:RDF>

