<div>This is linked with new feature.. Add punch support, although the code existed before also, but the &#39;punch&#39; has been specifically handled through</div><div>cmd = XFS_IOC_UNRESVP.</div><div> </div><div>Also, <strong>fallocate</strong> is moved out from  <em>&#39;xfs_iops.c&#39;</em> to &#39;file operations&#39; in <em>xfs_file.c</em>, which handles the case for    </div>
<div> </div><div>if (mode &amp; ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))<br>               return -EOPNOTSUPP;</div><div>...</div><div>if(mode &amp; FALLOC_FL_PUNCH_HOLE)<br>                cmd = XFS_IOC_UNRESVSP;</div>
<div>...</div><div>Now, for old kernels, how to make sure that this test case does not execute or return meaningful error? without changing the kernel code it will not return error;</div><div>Since, <strong>FALLOC_FL_KEEP_SIZE </strong>this is true and the command work with XFS_IOC_RESVP.</div>
<div> </div><div>Please suggest.</div><div> </div><div> </div><div>Thanks &amp; Regards,</div><div>Amit Sahrawat</div><div><br><br> </div><div class="gmail_quote">On Thu, Jun 23, 2011 at 12:06 PM, Amit Sahrawat <span dir="ltr">&lt;<a href="mailto:amit.sahrawat83@gmail.com">amit.sahrawat83@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote"><div>Fortunately or Unfortunately I have 2.6.31(x86) and 2.6.35.13(ARM) and both do not support &quot;fpunch&quot;. As per your earlier mail - 2.6.35.y does not support &quot;fpunch&quot; so I though of trying on 2.6.31.y.</div>

<div> </div><div>I will check out for the return errors in this condition and will update more on this. </div><div> </div><div>Thanks &amp; Regards,</div><div>Amit Sahrawat</div><div><div></div><div class="h5"><div><br><br>
 </div><div class="gmail_quote">
On Thu, Jun 23, 2011 at 11:50 AM, Dave Chinner <span dir="ltr">&lt;<a href="mailto:david@fromorbit.com" target="_blank">david@fromorbit.com</a>&gt;</span> wrote:<br><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">

<div>On Thu, Jun 23, 2011 at 11:21:26AM +0530, Amit Sahrawat wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; *PLATFORM      -- Linux/i686 localhost 2.6.31.5-127.fc12.i686.PAE*<br>
                                         ^^^^^^^^^^^<br>
&gt;<br>
&gt; The output as per the command mentioned by you:<br>
&gt; [root@localhost xfstests-2011-05-11]# xfs_io -f -c &quot;truncate 20k&quot; -c &quot;falloc<br>
&gt; 0 20k&quot; -c &quot;pwrite 0k 8k&quot; -c &quot;fs<br>
&gt; ync&quot; -c &quot;pwrite 12k 8k&quot; -c &quot;fsync&quot; -c &quot;fpunch 4k 12k&quot; -c &quot;fiemap -v&quot;<br>
&gt; /media/c/newfile<br>
&gt; wrote 8192/8192 bytes at offset 0<br>
&gt; 8 KiB, 2 ops; 0.0000 sec (434.028 MiB/sec and 111111.1111 ops/sec)<br>
&gt; command &quot;fs<br>
&gt; ync&quot; not found<br>
&gt; wrote 8192/8192 bytes at offset 12288<br>
&gt; 8 KiB, 2 ops; 0.0000 sec (977 MiB/sec and 250000.0000 ops/sec)<br>
&gt; /media/c/newfile:<br>
&gt; * EXT: FILE-OFFSET      BLOCK-RANGE      TOTAL FLAGS<br>
&gt;    0: [0..15]:         176..191            16   0x0<br>
&gt;    1: [16..23]:        192..199             8 0x800<br>
&gt;    2: [24..39]:        200..215            16   0x1<br>
</div>&gt; *<br>
<br>
The fpunch command did not punch the range out.<br>
<br>
Amit, once again you&#39;re testing on a kernel (2.6.31) that does not<br>
support the punch operation. As I suggested previously, you need to<br>
find out why the fpunch command is not returning an error as that is<br>
root cause of your failures.<br>
<div><div></div><div><br>
Cheers,<br>
<br>
Dave.<br>
--<br>
Dave Chinner<br>
<a href="mailto:david@fromorbit.com" target="_blank">david@fromorbit.com</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>