<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Short answer: You're looking in the wrong place.  What you're looking at is the policy that the file was created under.  For the actual details of the first offset in the file, look at objects[0].l_ost_idx.</div>
<div><br>
</div>
<div>-Ben Evans</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>lustre-discuss <<a href="mailto:lustre-discuss-bounces@lists.lustre.org">lustre-discuss-bounces@lists.lustre.org</a>> on behalf of John Bauer <<a href="mailto:bauerj@iodoctors.com">bauerj@iodoctors.com</a>><br>
<span style="font-weight:bold">Date: </span>Saturday, April 30, 2016 at 4:45 PM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:lustre-discuss@lists.lustre.org">lustre-discuss@lists.lustre.org</a>" <<a href="mailto:lustre-discuss@lists.lustre.org">lustre-discuss@lists.lustre.org</a>><br>
<span style="font-weight:bold">Subject: </span>[lustre-discuss] llapi_file_get_stripe() and lmm_stripe_offset<br>
</div>
<div><br>
</div>
<div>
<div bgcolor="#FFFFFF" text="#000000">
<p>I have noticed some inconsistencies in the <b>lfs setstripe/getstripe </b>commands and
<b>llapi_file_get_stripe(</b>) function.   Notice in the lfs setstripe/getstripe example below that specifying 7 for the offset with lfs setstripe -i 7 results in lfs getstripe reporting lmm_stripe_offset=7.  That all looks good.  But the simple program below
 that calls <b>llapi_file_get_stripe() </b>and prints out the <b>lmm_XXX</b> values reports
<b>lmm_stripe_o</b><b>ffset</b><b>=0</b>.  Doesn't seem right.<br>
</p>
<font face="Courier New,Courier,monospace">% lfs setstripe -c 4 -i <b><font color="#ff0000">7</font></b> file.dat<br>
% lfs getstripe file.dat<br>
file.dat<br>
lmm_stripe_count:   4<br>
lmm_stripe_size:    1048576<br>
lmm_pattern:        1<br>
lmm_layout_gen:     0<br>
lmm_stripe_offset:  <b><font color="#ff0000">7</font></b><br>
        obdidx           objid           objid           group<br>
             7         5611546       0x55a01a                0<br>
             0         5607846       0x5591a6                0<br>
             8         5612725       0x55a4b5                0<br>
            16         5611434       0x559faa                0</font><br>
<p><br>
</p>
<p>But whenever I call llapi_file_get_stripe(), the value <b>lmm_stripe_offset</b> that is returned in the
<b>struct lov_user_md</b> is always 0.</p>
<p><font face="Courier New,Courier,monospace"><br>
% <b>./main.exe file.dat</b><br>
0=llapi_file_get_stripe()<br>
lmm_stripe_count=4<br>
lmm_stripe_size=1048576<br>
lmm_pattern=1<br>
lmm_layout_gen=0<br>
<font color="#ff0000">lmm_stripe_offset=0</font><br>
% <b>cat main.c</b><br>
#include <stdlib.h><br>
#include <stdio.h><br>
#include <string.h><br>
<br>
#include "lustre/lustre_user.h"<br>
<br>
main(int argc, char **argv){<br>
   if( argc < 2 ) return -1 ;<br>
   char *fileName = argv[1] ;<br>
   struct lov_user_md_v3 lum ;<br>
   memset( &lum, 0, sizeof(lum) ) ;<br>
   int status = llapi_file_get_stripe(fileName, &lum);<br>
   fprintf(stderr,"%d=llapi_file_get_stripe()\n",status);<br>
   if( status != 0 ) return -1 ;<br>
   fprintf(stderr,"lmm_stripe_count=%d\n",lum.lmm_stripe_count);<br>
   fprintf(stderr,"lmm_stripe_size=%lld\n",lum.lmm_stripe_size);<br>
   fprintf(stderr,"lmm_pattern=%d\n",lum.lmm_pattern);<br>
   fprintf(stderr,"lmm_layout_gen=%d\n",lum.lmm_layout_gen);<br>
   fprintf(stderr,"lmm_stripe_offset=%d\n",(int)lum.lmm_stripe_offset);<br>
   exit(0);<br>
}<br>
</font><br>
</p>
<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>
</div>
</div>
</span>
</body>
</html>