<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. &nbsp;What you're looking at is the policy that the file was created under. &nbsp;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 &lt;<a href="mailto:lustre-discuss-bounces@lists.lustre.org">lustre-discuss-bounces@lists.lustre.org</a>&gt; on behalf of John Bauer &lt;<a href="mailto:bauerj@iodoctors.com">bauerj@iodoctors.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Saturday, April 30, 2016 at 4:45 PM<br>
<span style="font-weight:bold">To: </span>&quot;<a href="mailto:lustre-discuss@lists.lustre.org">lustre-discuss@lists.lustre.org</a>&quot; &lt;<a href="mailto:lustre-discuss@lists.lustre.org">lustre-discuss@lists.lustre.org</a>&gt;<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.&nbsp;&nbsp; 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.&nbsp; That all looks good.&nbsp; 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>.&nbsp; 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:&nbsp;&nbsp; 4<br>
lmm_stripe_size:&nbsp;&nbsp;&nbsp; 1048576<br>
lmm_pattern:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br>
lmm_layout_gen:&nbsp;&nbsp;&nbsp;&nbsp; 0<br>
lmm_stripe_offset:&nbsp; <b><font color="#ff0000">7</font></b><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; obdidx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; group<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5611546&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x55a01a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5607846&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x5591a6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5612725&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x55a4b5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5611434&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x559faa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 &lt;stdlib.h&gt;<br>
#include &lt;stdio.h&gt;<br>
#include &lt;string.h&gt;<br>
<br>
#include &quot;lustre/lustre_user.h&quot;<br>
<br>
main(int argc, char **argv){<br>
&nbsp;&nbsp; if( argc &lt; 2 ) return -1 ;<br>
&nbsp;&nbsp; char *fileName = argv[1] ;<br>
&nbsp;&nbsp; struct lov_user_md_v3 lum ;<br>
&nbsp;&nbsp; memset( &amp;lum, 0, sizeof(lum) ) ;<br>
&nbsp;&nbsp; int status = llapi_file_get_stripe(fileName, &amp;lum);<br>
&nbsp;&nbsp; fprintf(stderr,&quot;%d=llapi_file_get_stripe()\n&quot;,status);<br>
&nbsp;&nbsp; if( status != 0 ) return -1 ;<br>
&nbsp;&nbsp; fprintf(stderr,&quot;lmm_stripe_count=%d\n&quot;,lum.lmm_stripe_count);<br>
&nbsp;&nbsp; fprintf(stderr,&quot;lmm_stripe_size=%lld\n&quot;,lum.lmm_stripe_size);<br>
&nbsp;&nbsp; fprintf(stderr,&quot;lmm_pattern=%d\n&quot;,lum.lmm_pattern);<br>
&nbsp;&nbsp; fprintf(stderr,&quot;lmm_layout_gen=%d\n&quot;,lum.lmm_layout_gen);<br>
&nbsp;&nbsp; fprintf(stderr,&quot;lmm_stripe_offset=%d\n&quot;,(int)lum.lmm_stripe_offset);<br>
&nbsp;&nbsp; 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>