<div dir="ltr">Hi,<br><br>Does lustre support SEEK_HOLE/SEEK_DATA flag for lseek?<br><br>I did some experiment with the below program to find out if lustre supports SEEK_HOLE and SEEK_DATA flag. I found that lustre always returns the end of the file for SEEK_HOLE and 0 for SEEK_DATA and as per the man page this is the simplest implementation that file system can have(If they dont want to support these flags). So just wanted to confirm. <br><div><br>Program :<br>========<br>#include &lt;unistd.h&gt;</div><div>#include &lt;sys/types.h&gt;</div><div>#include &lt;stdio.h&gt;</div><div>#include &lt;fcntl.h&gt;</div><div>#include &lt;stdlib.h&gt;</div><div>#define SEEK_OFF 10485760</div><div>int main()</div><div>{</div><div>    int fd; </div><div>    char buffer[80];</div><div>    int i = 0;</div><div>    static char message[]=&quot;Hello world&quot;;</div><div>    fd=open(&quot;myfile&quot;, O_RDWR);</div><div>    if (fd != -1) </div><div>        return 1;</div><div>    printf(&quot;creating hole by writing at each of %d strides\n&quot;, SEEK_OFF);</div><div>    for (i = 1; i &lt; 10; i++)</div><div>    {   </div><div>        int seek_off = i * SEEK_OFF;</div><div>        int sz; </div><div>        printf(&quot;seek_off %ld\n&quot;, lseek(fd, seek_off, SEEK_SET));</div><div>        sz = write(fd,message,sizeof(message));</div><div>        printf(&quot;write size = %d\n&quot;, sz);</div><div>        printf(&quot;String : %s\n&quot;, message);</div><div>    }   </div><div>    printf(&quot;Demonstrating SEEK_HOLE and SEEK_DATA %d \n&quot;, SEEK_OFF);</div><div>    int start_off = 0;</div><div>    lseek(fd, 0, SEEK_SET);</div><div>    printf(&quot;after SEEK_HOLE start_off %ld\n&quot;, lseek(fd, 0, SEEK_HOLE));</div><div>    printf(&quot;after SEEK_DATA start_off %ld\n&quot;, lseek(fd, start_off, SEEK_DATA));</div><div>    printf(&quot;after SEEK_HOLE start_off %ld\n&quot;, lseek(fd, 10485760, SEEK_HOLE));</div><div>    printf(&quot;after SEEK_DATA start_off %ld\n&quot;, lseek(fd, (10485760 *2 ), SEEK_DATA));</div><div>    close(fd);</div><div>}<br><br>output:<br>=====<br><div>after SEEK_HOLE start_off 94372142</div><div>after SEEK_DATA start_off 0</div><div>after SEEK_HOLE start_off 94372142</div><div>after SEEK_DATA start_off 0<br><br>Regards,<br>Lokesh</div></div></div>