[Gluster-devel] Fuse mount option: enable-ino32

Steve Bakke sbakke at netzyn.com
Mon Sep 17 23:13:31 UTC 2012


Found a temporary solution.  We patched xlators/protocol/client/src/client-helpers.c ~ line 159
was:     entry->d_ino = trav->d_ino
now:     entry->d_ino = GF_FUSE_SQUASH_INO(trav->d_info);

All the 32 bit apps that did not work before, now work.  Need both the original enable-ino32 patch and this one.

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.

Steve



________________________________
 From: Steve Bakke <sbakke at netzyn.com>
To: "gluster-devel at nongnu.org" <gluster-devel at nongnu.org> 
Sent: Monday, September 17, 2012 11:42 AM
Subject: Re: [Gluster-devel] Fuse mount option: enable-ino32
 

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.  
   printf("inode:%016lx file:%s\n", dirEntry.d_ino, dirEntry.d_name );
 

Also to make sure client was working correctly we added logging calls to gf_fuse_stat2attr() in fuse-helpers.c, at line 444 added:

   fprintf( mylogfile, "ino32: %i st:%lx fuse:%lx \n", enable_ino32, st->ia_ino, fa->ino );



When the test program was run, it printed this out:

inode:a2bdc7aeaee47329 file:steve.txt
inode:821222a0edf18a37 file:george.txt
inode:0000000000000001 file:.
inode:a7f29365717fb464 file:testnfs
inode:ffffffffffffffff file:..
inode:9aa3f33d3c366b4e file:fred.txt


The log file contained: 

ino32: 1 st:1 fuse:1 
ino32: 1 st:1 fuse:1 
ino32: 1 st:1 fuse:1 
ino32: 1 st:a2bdc7aeaee47329 fuse:c59b487 
ino32: 1 st:821222a0edf18a37 fuse:6fe3a897 
ino32: 1 st:a7f29365717fb464 fuse:d68d2701 
ino32: 1 st:9aa3f33d3c366b4e fuse:a6959873 
ino32: 1 st:1 fuse:1 
ino32: 1 st:1 fuse:1 
ino32: 1 st:1 fuse:1 
ino32: 1 st:1 fuse:1 
ino32: 1 st:1 fuse:1 


As the inode values return to the test program are > 32 bits, seems like there is some path that the inodes are not getting adjusted?

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 > 32 bits.

Steve



________________________________
 From: Niels de Vos <ndevos at redhat.com>
To: Steve Bakke <sbakke at netzyn.com> 
Cc: "gluster-devel at nongnu.org" <gluster-devel at nongnu.org> 
Sent: Monday, September 17, 2012 3:49 AM
Subject: Re: [Gluster-devel] Fuse mount option: enable-ino32
 
On 09/15/2012 11:15 PM, Steve Bakke wrote:
> All,
>
> Just compiled and installed the Sept 15 git which includes the fuse mount option enable-ino32 patch.
>
> Then on the server:
> gluster volume fred set enable-ino32 on
> Note: volume info prints out nfs.enable-ino32: on, which I guess is ok???

The volume option is for the NFS-server only. It does not affect the 
GlusterFS-native mount, therefore there is no need to set this option for the 
volume.

> On client:
> mount -t glusterfs -o enable-ino32 1.2.3.4:/fred mntfs

This is the correct usage.

> 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.
>
> Do I need to do something else??

Are you using the version with the patch on the client?
 The conversion of the 
64-bit to 32-bit inodes is done client-side, not server-side. This makes it 
possible for clients to choose if they want/need 32- or 64-bit inodes.

Cheers,
Niels


> Steve
>
>
>
> #include<stdlib.h>
> #include<stdio.h>
> #include<sys/types.h>
> #include<dirent.h>
>
> int main()
> {
>    DIR* hDir = opendir(".");
>    if (hDir==NULL)
>      return 1;
>
>    struct dirent dirEntry;
>    struct dirent * pOut;
>    int err = readdir_r(hDir,&dirEntry,&pOut);
>    while(err==0&&  pOut!=NULL)
>    {
>      printf("%s ", dirEntry.d_name);
>      err = readdir_r(hDir,&dirEntry,&pOut);
>   
 }
>
>    printf("\nLast Error: %d\n", err);
>
>    return 0;
> }
>
>
>
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at nongnu.org
> https://lists.nongnu.org/mailman/listinfo/gluster-devel


-- 
Niels de Vos
Software Maintenance Engineer
Global Support Services
Red Hat



_______________________________________________
Gluster-devel mailing list
Gluster-devel at nongnu.org
https://lists.nongnu.org/mailman/listinfo/gluster-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://supercolony.gluster.org/pipermail/gluster-devel/attachments/20120917/20a95369/attachment-0001.html>


More information about the Gluster-devel mailing list