[PATCH 5/7] util: virfile: Don't use VIR_FILE_SHFS_GFS2 for glusterfs

Peter Krempa pkrempa at redhat.com
Mon Sep 5 13:34:19 UTC 2022


While the code works properly as no code path is specifically wanting to
check for glusterfs, we should properly declare glusterfs as a separate
from GFS2.

Fixes: 478da65fb46
Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/util/virfile.c | 8 +++++---
 src/util/virfile.h | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 33a3ffe8f7..f5a61abd9f 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -3331,7 +3331,7 @@ struct virFileSharedFsData {
 };

 static const struct virFileSharedFsData virFileSharedFsFUSE[] = {
-    { .mnttype = "fuse.glusterfs", .fstype = VIR_FILE_SHFS_GFS2 },
+    { .mnttype = "fuse.glusterfs", .fstype = VIR_FILE_SHFS_GLUSTERFS },
     { .mnttype = "fuse.quobyte", .fstype = VIR_FILE_SHFS_QB },
 };

@@ -3668,7 +3668,8 @@ int virFileIsSharedFS(const char *path)
                                  VIR_FILE_SHFS_CEPH |
                                  VIR_FILE_SHFS_GPFS|
                                  VIR_FILE_SHFS_QB |
-                                 VIR_FILE_SHFS_ACFS);
+                                 VIR_FILE_SHFS_ACFS |
+                                 VIR_FILE_SHFS_GLUSTERFS);
 }


@@ -3681,7 +3682,8 @@ virFileIsClusterFS(const char *path)
     return virFileIsSharedFSType(path,
                                  VIR_FILE_SHFS_GFS2 |
                                  VIR_FILE_SHFS_OCFS |
-                                 VIR_FILE_SHFS_CEPH);
+                                 VIR_FILE_SHFS_CEPH |
+                                 VIR_FILE_SHFS_GLUSTERFS);
 }


diff --git a/src/util/virfile.h b/src/util/virfile.h
index c4d11ea21a..f7a31d9f57 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -222,6 +222,7 @@ enum {
     VIR_FILE_SHFS_GPFS = (1 << 7), /* General Parallel File System/IBM Spectrum Scale */
     VIR_FILE_SHFS_QB = (1 << 8), /* Quobyte shared filesystem */
     VIR_FILE_SHFS_ACFS = (1 << 9), /* Oracle ASM Cluster File System */
+    VIR_FILE_SHFS_GLUSTERFS = (1 << 10), /* gluster's FUSE-based client */
 };

 int virFileIsSharedFSType(const char *path, unsigned int fstypes) ATTRIBUTE_NONNULL(1);
-- 
2.37.1



More information about the libvir-list mailing list