<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>I am experiencing an intermittent problem with fiemap on Lustre. 
      This is running on pleiades NASA Ames.</p>
    <p>lustre: 2.7.1<br>
      kernel: 3.0.101-68.1.20160209-nasa<br>
      build:  2.7.1-3nasC_mofed31v5<br>
    </p>
    <p>I create a file with <b><font face="Courier New, Courier,
          monospace">dd if=/dev/zero of=${FILE} count=100 bs=1M</font></b>
      and then run my program to do the fcntl call to get the fiemap. 
      About 1 out of 10 times the contents of the fiemap has an extra
      extent in it. The bad extent info is only generated when run
      immediately after the file is created by dd.  All subsequent runs
      of my simple program report the correct extent info.  Any ideas? <br>
    </p>
    <p>Thanks, John</p>
    <p><font face="Courier New, Courier, monospace">incorrect immediately
        after creation<br>
        listExtents() fe_device=132 fe_length=2097152<br>
        listExtents() fe_device=132 fe_length=12582912<br>
        listExtents() fe_device=105 fe_length=8388608<br>
        listExtents() fe_device=105 fe_length=6291456<br>
        listExtents() fe_device=36 fe_length=12582912<br>
        listExtents() fe_device=48 fe_length=4194304<br>
        listExtents() fe_device=48 fe_length=8388608<br>
        listExtents() fe_device=47 fe_length=2097152<br>
        listExtents() fe_device=47 fe_length=10485760<br>
        listExtents() fe_device=201 fe_length=1048576<br>
        listExtents() fe_device=201 fe_length=11534336<br>
        <b><font color="#ff0000">listExtents() fe_device=59
            fe_length=4194304<br>
            listExtents() fe_device=59 fe_length=6291456<br>
            listExtents() fe_device=59 fe_length=8388608</font></b><br>
        listExtents() fe_device=218 fe_length=12582912<br>
        listExtents() nMapped=15 byteCount=111149056</font></p>
    <p>correct: all subsequent runs<br>
    </p>
    <font face="Courier New, Courier, monospace">listExtents()
      fe_device=132 fe_length=2097152<br>
      listExtents() fe_device=132 fe_length=12582912<br>
      listExtents() fe_device=105 fe_length=8388608<br>
      listExtents() fe_device=105 fe_length=6291456<br>
      listExtents() fe_device=36 fe_length=12582912<br>
      listExtents() fe_device=48 fe_length=4194304<br>
      listExtents() fe_device=48 fe_length=8388608<br>
      listExtents() fe_device=47 fe_length=2097152<br>
      listExtents() fe_device=47 fe_length=10485760<br>
      listExtents() fe_device=201 fe_length=1048576<br>
      listExtents() fe_device=201 fe_length=11534336<br>
      <b><font color="#ff0000">listExtents() fe_device=59
          fe_length=4194304<br>
          listExtents() fe_device=59 fe_length=8388608</font></b><br>
      listExtents() fe_device=218 fe_length=12582912<br>
      listExtents() nMapped=14 byteCount=104857600<br>
      <br>
      <br>
      <br>
            int rc = ioctl(info->fd, FS_IOC_FIEMAP, (unsigned long)
      fiemap);<br>
            if (rc < 0) {<br>
               fprintf(stderr,"ioctl(FS_IOC_FIEMAP) error
      %s\n",strerror(errno));<br>
               return -1 ;<br>
            }<br>
      <br>
            listExtents( fiemap ) ;<br>
      <br>
      <br>
      int<br>
      listExtents( struct fiemap *fiemap ){<br>
      int i ;<br>
         int nMapped = fiemap->fm_mapped_extents ;<br>
         long long byteCount = 0 ;<br>
         for(i=0;i<nMapped;i++){<br>
            struct fiemap_extent *cur  = fiemap->fm_extents+i;<br>
            byteCount += cur->fe_length ;<br>
            fprintf(stderr,"%s() fe_device=%d
      fe_length=%lld\n",__func__,cur->fe_device,cur->fe_length);<br>
         }<br>
         fprintf(stderr,"%s() nMapped=%d
      byteCount=%lld\n",__func__,nMapped,byteCount);<br>
      <br>
    </font><br>
    <br>
    <pre class="moz-signature" cols="72">-- 
I/O Doctors, LLC
507-766-0378
<a class="moz-txt-link-abbreviated" href="mailto:bauerj@iodoctors.com">bauerj@iodoctors.com</a></pre>
  </body>
</html>