<br><br><div class="gmail_quote">On Wed, Feb 13, 2013 at 2:47 PM, Theodore Ts&#39;o <span dir="ltr">&lt;<a href="mailto:tytso@mit.edu" target="_blank">tytso@mit.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Feb 13, 2013 at 05:41:41PM -0500, J. Bruce Fields wrote:<br>
&gt; &gt; What if we have an ioctl or a process personality flag where a broken<br>
&gt; &gt; application can tell the file system &quot;I&#39;m broken, please give me a<br>
&gt; &gt; degraded telldir/seekdir cookie&quot;?  That way we don&#39;t penalize programs<br>
&gt; &gt; that are doing the right thing, while providing some accomodation for<br>
&gt; &gt; programs who are abusing the telldir cookie.<br>
&gt;<br>
&gt; Yeah, if there&#39;s a simple way to do that, maybe it would be worth it.<br>
<br>
</div>Doing this as an ioctl which gets called right after opendir, i.e<br>
(ignoring error checking):<br>
<br>
      DIR *dir = opendir(&quot;/foo/bar/baz&quot;);<br>
      ioctl(dirfd(dir), EXT4_IOC_DEGRADED_READDIR, 1);<br>
      ...<br>
<br>
should be quite easy.  It would be a very ext3/4 specific thing,<br>
though.</blockquote><div><br></div><div>That would work, even though it would be ext3/4 specific. What is the recommended programmatic way to detect if the file is on ext3/4 -- we would not want to attempt that blindly on a non-ext3/4 FS as the numerical value of EXT4_IOC_DEGRADED_READDIR might get interpreted in dangerous ways?</div>
<div><br></div><div>Avati</div></div>