]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-vfs_glusterfs: always disable write-behind translator
authorGünther Deschner <gd@samba.org>
Mon, 2 Nov 2020 15:10:44 +0000 (16:10 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 2 Dec 2020 14:50:18 +0000 (14:50 +0000)
The "pass-through" option has now been merged upstream as of:
https://github.com/gluster/glusterfs/pull/1640

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14486

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Pair-Programmed-With: Anoop C S <anoopcs@samba.org>
Pair-Programmed-With: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Nov  4 22:53:49 UTC 2020 on sn-devel-184

(cherry picked from commit a51cda69ec6a017ad04b5690a3ae67a5478deee9)

Autobuild-User(v4-13-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-13-test): Thu Nov  5 13:54:25 UTC 2020 on sn-devel-184

source3/modules/vfs_glusterfs.c
source3/wscript

index 190235cf8ae5ebba17d2fb46653c6b64a740ca9a..4e1dc1695652f89f366cd038d499b94dc18c9d0a 100644 (file)
@@ -365,6 +365,7 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
        glfs_t *fs = NULL;
        TALLOC_CTX *tmp_ctx;
        int ret = 0;
+       bool write_behind_pass_through_set = false;
 
        tmp_ctx = talloc_new(NULL);
        if (tmp_ctx == NULL) {
@@ -424,6 +425,17 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
                goto done;
        }
 
+#ifdef HAVE_GFAPI_VER_7_9
+       ret = glfs_set_xlator_option(fs, "*-write-behind", "pass-through",
+                                    "true");
+       if (ret < 0) {
+               DBG_ERR("%s: Failed to set xlator option: pass-through\n",
+                       volume);
+               goto done;
+       }
+       write_behind_pass_through_set = true;
+#endif
+
        ret = glfs_set_logging(fs, logfile, loglevel);
        if (ret < 0) {
                DEBUG(0, ("%s: Failed to set logfile %s loglevel %d\n",
@@ -438,9 +450,11 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
                goto done;
        }
 
-       ret = check_for_write_behind_translator(tmp_ctx, fs, volume);
-       if (ret < 0) {
-               goto done;
+       if (!write_behind_pass_through_set) {
+               ret = check_for_write_behind_translator(tmp_ctx, fs, volume);
+               if (ret < 0) {
+                       goto done;
+               }
        }
 
        ret = glfs_set_preopened(volume, handle->conn->connectpath, fs);
index 7b257bcb845a9a77116b6d2ff6a4aa980a66efb0..47f97c60321d3a97ef0748598ce41d6f4cb6bb1d 100644 (file)
@@ -1591,6 +1591,9 @@ main() {
         conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 7.6" --cflags --libs',
                        msg='Checking for glusterfs-api >= 7.6',
                        uselib_store="GFAPI_VER_7_6")
+        conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 7.9" --cflags --libs',
+                       msg='Checking for glusterfs-api >= 7.9',
+                       uselib_store="GFAPI_VER_7_9")
     else:
         conf.SET_TARGET_TYPE('gfapi', 'EMPTY')
         conf.undefine('HAVE_GLUSTERFS')