open-mpi / ompi

Open MPI main development repository
https://www.open-mpi.org
Other
2.13k stars 858 forks source link

statfs() on RHEL 6.5 lies about enfs (reports it as NFS) #206

Open ompiteam opened 10 years ago

ompiteam commented 10 years ago

On July 7, 2014, the nightly builds failed due to a failure in the test/util/opal_path_nfs test. I noticed on the build machine, the following mount was present:

[9:20] jaguar:~/tmp % mount | grep dikim
encfs on /nfs/users/dikim/.passwords type fuse.encfs (rw,nosuid,nodev,default_permissions,user=dikim)
[9:20] jaguar:~/tmp % 

It looks like statfs() is lying about the type of filesystem for this mount. Specifically:

[9:20] jaguar:~/tmp % cat foo.c
#include <stdio.h>
#include <sys/vfs.h>

int main()
{
    struct statfs buf;
    const char *file = "/nfs/users/dikim/.passwords";
    int rc = statfs(file, &buf);
    printf("ret:%d, f type: 0x%x\n", rc, buf.f_type);
    return 0;
}
[9:21] jaguar:~/tmp % gcc foo.c -o foo.x -g && ./foo.x
ret:0, f type: 0x6969
[9:21] jaguar:~/tmp % 

According to statfs(2) on RHEL 6.5, 0x6969 is the super magic value for NFS. fuse/encfs is not listed.

I.e., I ''suspect'' that statfs() is confused about the filesystem type of this mount and just gives it an NFS value, especially since there's another mount on this machine:

[9:23] jaguar:~/tmp % mount | grep users
encfs on /nfs/users/dikim/.passwords type fuse.encfs (rw,nosuid,nodev,default_permissions,user=dikim)
deep-thought.osl.iu.edu:/home/users on /nfs/users type nfs (rw,nosuid,nodev,soft,intr,sloppy,addr=10.79.247.75)
[9:23] jaguar:~/tmp % 

So I don't know if there's really anything we can do about this -- if statfs() lies to us, I'm not sure what we can do... But I figured I'd file this bug just to record what happened.

ompiteam commented 10 years ago

Imported from trac issue 4767. Created by jsquyres on 2014-07-08T09:24:19, last modified: 2014-07-08T09:39:40

ompiteam commented 10 years ago

Trac comment by jsquyres on 2014-07-08 09:29:03:

Actually, IU has indicated that they want to keep this fuse mount. So I made the test skip fuse filesystem mounts.

ompiteam commented 10 years ago

Trac comment by jsquyres on 2014-07-08 09:30:49:

(In [32152]) opal_path_nfs.c test: skip fuse filesystems

Linux statfs(2) lies about the type of fuse filesystems (it reports fuse.encfs as an NFS filesystem). So just skip fuse filesystems in this test until/if we ever care to add some kind of workaround.

Refs https://svn.open-mpi.org/trac/ompi/ticket/4767

cmr=v1.8.2:reviewer=rhc

ompiteam commented 10 years ago

Trac comment by jsquyres on 2014-07-08 09:39:40:

If anyone wants to fix opal_path_nfs(), Ralph found this link that shows that fuse has had a history of problems with statfs(). They suggest parsing /proc/mounts or /proc/self/mountinfo instead:

http://comments.gmane.org/gmane.comp.file-systems.fuse.devel/7672