Re: A problem with fstat64 system call on nfs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> From: "Александр Берсенев" <bay@xxxxxxxxxxxx>
> To: gluster-devel@xxxxxxxxxx
> Sent: Thursday, March 17, 2011 5:05:57 PM
> Subject: A problem with fstat64 system call on nfs.
> I am experimenting with glusterfs on cluster.
> I have a ~20 glusterfs servers. They communicating between each other
> via Infiniband.
> One of client machine have no Infiniband board, so I mounted the
> glusterfs volume on this client machine via nfs.
> 
> I used this command:
> mount -t nfs server:/share /mount
> 
> When I try to do fstat64 on any file from the nfs mount, the stat call
> fails because of stack corruption.
> 
> Here is a small source of a fstat test:
> 
> #include <stdlib.h>
> #include <stdio.h>
> #include <unistd.h>
> #include <sys/file.h>
> #include <sys/stat.h>
> 
> int main(int argc, char **argv){
> if(argc!=2) {
> printf("Usage: ./progname <file>");
> exit(1);
> }
> 
> int h=open(argv[1], O_RDONLY);
> if(h<0) {
> printf("Open failed\n");
> exit(1);
> }
> 
> struct stat s;
> int f=fstat(h,&s);
> if(f<0) {
> printf("Stat failed\n");
> exit(1);
> }
> 
> printf("Size: %d\n",s.st_size);
> return 0;
> }
> 
> When I compiling this source with this command: gcc -m32 1.c , all
> fstat64 calls from nfs mount is fails:
> [u1333@um64 bay]$ ./a.out aaaaaa
> Stat failed
> 
> But with non-gluster nfs mount and local files the program is working
> correctly:
> [u1333@um64 bay]$ ./a.out /etc/passwd
> Size: 1743
> 
> When I compiling this source with another command: gcc -m64 1.c , all
> is working. Strace shows fstat calls instead of fstat64.
> [u1333@um64 bay]$ ./a.out aaaaaa
> Size: 2
> [u1333@um64 bay]$ ./a.out /etc/passwd
> Size: 1743
> 
> Steps for reproduce:
> 1) Mount glusterfs via nfs.
> 2) Compile a source with -m32
> 3) Execute ./a.out <file on nfs>
> 
> Is it glusterfs bug?

I dont think this is a bug. It has probably got something to do with the difference in inode number size. Anyway, we can confirm this by the following steps:

1. In source, along with the line:

printf("Stat failed\n");

..please print strerror(errno). i.e change the above line to:

printf("Stat failed: %s\n", strerror(errno));

I need to see what error number the fstat syscall fails with.

3. please recompile as:

gcc -m32 1.c

and re-run the test.

2. Once the test finishes. Please send me the output of the program above and the output of:

$ dmesg |tail 
$ uname -a


With this info, I can figure out whats going on. Thanks.


> 
> ---
> Alexander Bersenev(Russia)
> 
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel@xxxxxxxxxx
> http://lists.nongnu.org/mailman/listinfo/gluster-devel



[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux