The right place to do it is in fuse_readdir_cbk, based on priv-&gt;enable_ino32 (see c13823bd16b26bc471d3efb15f63b76fbfdf0309)<div><br></div><div>Avati</div><div><br><div class="gmail_quote">On Mon, Sep 17, 2012 at 4:13 PM, Steve Bakke <span dir="ltr">&lt;<a href="mailto:sbakke@netzyn.com" target="_blank">sbakke@netzyn.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div><span>Found a temporary solution.  W</span><span style="background-color:transparent">e patched xlators/protocol/client/src/client-helpers.c ~ line 159</span></div>
<div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">was:     entry-&gt;d_ino = trav-&gt;d_ino</div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span>now:     entry-&gt;d_ino = GF_FUSE_SQUASH_INO(trav-&gt;d_info);</span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br>
</span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>All the 32 bit apps that did not work before, now work.  Need both the original enable-ino32 patch and this one.</span></div>
<div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">
Not sure what the actual patch should be, but this does work at least for our running only 32 bit apps on a Gluster mount.</div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span><br></span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span style="background-color:transparent">Steve</span><br></div><div>
<br></div>  <div style="font-family:arial,helvetica,sans-serif;font-size:10pt"> <div style="font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif;font-size:12pt"> <div dir="ltr"> <font face="Arial"> <hr size="1">
  <b><span style="font-weight:bold">From:</span></b> Steve Bakke &lt;<a href="mailto:sbakke@netzyn.com" target="_blank">sbakke@netzyn.com</a>&gt;<br> <b><span style="font-weight:bold">To:</span></b> &quot;<a href="mailto:gluster-devel@nongnu.org" target="_blank">gluster-devel@nongnu.org</a>&quot; &lt;<a href="mailto:gluster-devel@nongnu.org" target="_blank">gluster-devel@nongnu.org</a>&gt; <br>
 <b><span style="font-weight:bold">Sent:</span></b> Monday, September 17, 2012 11:42 AM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [Gluster-devel] Fuse mount option: enable-ino32<br> </font> </div> <br>

<div><div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div><span><font>Yes we are running the patched version on client.  We modified the print line in our test program to display the inode values and compiled the program for 64 bit mode, so it will run.  </font></span></div>
<div style="background-color:transparent"><span><font><div style="background-color:transparent">   printf(&quot;inode:%016lx file:%s\n&quot;, dirEntry.d_ino, dirEntry.d_name );</div><div style="background-color:transparent">
 </div></font></span></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><font><br></font></span></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span><font>Also to make sure client was working correctly we added logging calls to gf_fuse_stat2attr() in fuse-helpers.c, at line 444 added:</font></span></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<br></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><font><div style="background-color:transparent"><span><div style="font-size:16px;background-color:transparent">
<font>   fprintf( mylogfile, &quot;ino32: %i st:%lx fuse:%lx \n&quot;, enable_ino32, st-&gt;ia_ino, fa-&gt;ino );</font></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<font><br></font></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif"><font><br></font></div><br></span></div></font></span></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span><font>When the test program was run, it printed this out:</font></span></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><font><br>
</font></span></div><div style="background-color:transparent"><span><font><div style="background-color:transparent">inode:a2bdc7aeaee47329
 file:steve.txt</div><div style="background-color:transparent">inode:821222a0edf18a37 file:george.txt</div><div style="background-color:transparent">inode:0000000000000001 file:.</div><div style="background-color:transparent">
inode:a7f29365717fb464 file:testnfs</div><div style="background-color:transparent">inode:ffffffffffffffff file:..</div><div style="background-color:transparent">inode:9aa3f33d3c366b4e file:fred.txt</div><div style="font-style:normal;font-size:12.727272033691406px;font-family:arial,helvetica,sans-serif">
<br></div></font></span></div><div style="font-style:normal;font-size:12.727272033691406px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br></div><div style="background-color:transparent"><span><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">
The log file
 contained: </div></span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="background-color:transparent">
<span><div style="background-color:transparent"><div style="background-color:transparent"><font><div style="background-color:transparent">ino32: 1 st:1 fuse:1 </div><div style="background-color:transparent">ino32: 1 st:1 fuse:1 </div>
<div style="background-color:transparent">ino32: 1 st:1 fuse:1 </div><div style="background-color:transparent">ino32: 1 st:a2bdc7aeaee47329 fuse:c59b487 </div><div style="background-color:transparent">ino32: 1 st:821222a0edf18a37 fuse:6fe3a897 </div>
<div style="background-color:transparent">ino32: 1 st:a7f29365717fb464 fuse:d68d2701 </div><div style="background-color:transparent">ino32: 1
 st:9aa3f33d3c366b4e fuse:a6959873 </div><div style="background-color:transparent">ino32: 1 st:1 fuse:1 </div><div style="background-color:transparent">ino32: 1 st:1 fuse:1 </div><div style="background-color:transparent">
ino32: 1 st:1 fuse:1 </div><div style="background-color:transparent">ino32: 1 st:1 fuse:1 </div><div style="background-color:transparent">ino32: 1 st:1 fuse:1 </div></font></div></div></span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span><br></span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span>As the inode values return to the test program are &gt; 32 bits, seems like there is some path that the inodes are not getting adjusted?</span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span><br></span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span>When we compile the test program in 32 bit mode, we get error 75, which is EOVERFLOW. Looking at the 32bit Getdents (called by readdir) EOVERFLOW is returned when inode values are &gt; 32 bits.</span></div>
<div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif">
<span>Steve</span></div><div style="font-style:normal;font-size:13.63636302947998px;background-color:transparent;font-family:arial,helvetica,sans-serif"><span><br></span></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">
<br></div>  <div style="font-family:arial,helvetica,sans-serif;font-size:10pt"> <div style="font-family:&#39;times new roman&#39;,&#39;new york&#39;,times,serif;font-size:12pt"> <div dir="ltr"> <font face="Arial"> <hr size="1">
  <b><span style="font-weight:bold">From:</span></b> Niels de Vos &lt;<a href="mailto:ndevos@redhat.com" target="_blank">ndevos@redhat.com</a>&gt;<br> <b><span style="font-weight:bold">To:</span></b> Steve Bakke &lt;<a href="mailto:sbakke@netzyn.com" target="_blank">sbakke@netzyn.com</a>&gt; <br>
<b><span style="font-weight:bold">Cc:</span></b> &quot;<a href="mailto:gluster-devel@nongnu.org" target="_blank">gluster-devel@nongnu.org</a>&quot; &lt;<a href="mailto:gluster-devel@nongnu.org" target="_blank">gluster-devel@nongnu.org</a>&gt; <br>
 <b><span style="font-weight:bold">Sent:</span></b> Monday, September 17, 2012 3:49 AM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [Gluster-devel] Fuse mount option: enable-ino32<br> </font> </div><div><div class="h5">
 <br>
On 09/15/2012 11:15 PM, Steve Bakke wrote:<br>&gt; All,<br>&gt;<br>&gt; Just compiled and installed the Sept 15 git which includes the fuse mount option enable-ino32 patch.<br>&gt;<br>&gt; Then on the server:<br>&gt; gluster volume fred set enable-ino32 on<br>
&gt; Note: volume info prints out nfs.enable-ino32: on, which I guess is ok???<br><br>The volume option is for the NFS-server only. It does not affect the <br>GlusterFS-native mount, therefore there is no need to set this option for the <br>
volume.<br><br>&gt; On client:<br>&gt; mount -t glusterfs -o enable-ino32 1.2.3.4:/fred mntfs<br><br>This is the correct usage.<br><br>&gt; Mounts, but still returns wrong entries, using the test program below.  This program works fine with using nfs mount, and with nfs.enable-ino32 on server.  However for other reasons must use native client.<br>
&gt;<br>&gt; Do I need to do something else??<br><br>Are you using the version with the patch on the client?
 The conversion of the <br>64-bit to 32-bit inodes is done client-side, not server-side. This makes it <br>possible for clients to choose if they want/need 32- or 64-bit inodes.<br><br>Cheers,<br>Niels<br><br><br>&gt; Steve<br>
&gt;<br>&gt;<br>&gt;<br>&gt; #include&lt;stdlib.h&gt;<br>&gt; #include&lt;stdio.h&gt;<br>&gt; #include&lt;sys/types.h&gt;<br>&gt; #include&lt;dirent.h&gt;<br>&gt;<br>&gt; int main()<br>&gt; {<br>&gt;    DIR* hDir = opendir(&quot;.&quot;);<br>
&gt;    if (hDir==NULL)<br>&gt;      return 1;<br>&gt;<br>&gt;    struct dirent dirEntry;<br>&gt;    struct dirent * pOut;<br>&gt;    int err = readdir_r(hDir,&amp;dirEntry,&amp;pOut);<br>&gt;    while(err==0&amp;&amp;  pOut!=NULL)<br>
&gt;    {<br>&gt;      printf(&quot;%s &quot;, dirEntry.d_name);<br>&gt;      err = readdir_r(hDir,&amp;dirEntry,&amp;pOut);<br>&gt;   
 }<br>&gt;<br>&gt;    printf(&quot;\nLast Error: %d\n&quot;, err);<br>&gt;<br>&gt;    return 0;<br>&gt; }<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Gluster-devel mailing list<br>
&gt; <a rel="nofollow" href="mailto:Gluster-devel@nongnu.org" target="_blank">Gluster-devel@nongnu.org</a><br>&gt; <a rel="nofollow" href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
<br><br>-- <br>Niels de Vos<br>Software Maintenance Engineer<br>Global Support Services<br>Red Hat<br><br><br> </div></div></div> </div>  </div></div></div><div><div class="h5"><br>_______________________________________________<br>
Gluster-devel mailing list<br><a href="mailto:Gluster-devel@nongnu.org" target="_blank">Gluster-devel@nongnu.org</a><br><a href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
<br><br> </div></div></div> </div>  </div></div><br>_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@nongnu.org">Gluster-devel@nongnu.org</a><br>
<a href="https://lists.nongnu.org/mailman/listinfo/gluster-devel" target="_blank">https://lists.nongnu.org/mailman/listinfo/gluster-devel</a><br>
<br></blockquote></div><br></div>