<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body 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>
</body>
</html>