diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2018-10-09 13:08:07 +0200 |
---|---|---|
committer | Michal Privoznik <mprivozn@redhat.com> | 2018-10-10 17:14:45 +0200 |
commit | 1dbf6222dd5e1fedcbe335fc0852ef66e7a92901 (patch) | |
tree | 020d74022d358008878be858711315cf4f4c9d57 /tests | |
parent | 98ca1d52a2a871e1c068504450b4dc15db063ef4 (diff) | |
download | libvirt-1dbf6222dd5e1fedcbe335fc0852ef66e7a92901.tar.gz |
virfile: Rework virFileIsSharedFixFUSE
There are couple of things wrong with the current implementation.
The first one is that in the first loop the code tries to build a
list of fuse.glusterfs mount points. Well, since the strings are
allocated in a temporary buffer and are not duplicated this
results in wrong decision made later in the code.
The second problem is that the code does not take into account
subtree mounts. For instance, if there's a fuse.gluster mounted
at /some/path and another FS mounted at /some/path/subdir the
code would not recognize this subdir mount.
Reported-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/virfiledata/mounts3.txt | 2 | ||||
-rw-r--r-- | tests/virfiletest.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/virfiledata/mounts3.txt b/tests/virfiledata/mounts3.txt index 226f67dc00..134c6e8f81 100644 --- a/tests/virfiledata/mounts3.txt +++ b/tests/virfiledata/mounts3.txt @@ -31,3 +31,5 @@ hugetlbfs /hugepages2M hugetlbfs rw,relatime,mode=1777,pagesize=2M 0 0 none /run/user/1000 tmpfs rw,relatime,mode=700,uid=1000 0 0 host:/nfs /nfs nfs4 rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp6,timeo=600,retrans=2,sec=sys,clientaddr=::,local_lock=none,addr=:: 0 0 dev /nfs/blah devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=4093060,mode=755 0 0 +host:/gv0 /gluster fuse.glusterfs rw 0 0 +root@host:/tmp/mkdir /gluster/sshfs fuse.sshfs rw 0 0 diff --git a/tests/virfiletest.c b/tests/virfiletest.c index 42d918aecc..d5102b1cc4 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -454,6 +454,8 @@ mymain(void) DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts2.txt", "/run/user/501/gvfs/some/file", false); DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/nfs/file", true); DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/nfs/blah", false); + DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/gluster/file", true); + DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/gluster/sshfs/file", false); return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS; } |