The branch, v4-11-test has been updated
       via  f1b1dc12aba vfs_glusterfs: print exact cmdline for disabling 
write-behind translator
       via  eb525a3e070 manpages/vfs_glusterfs: Mention silent skipping of 
write-behind translator
       via  d6fb44cba25 s3-vfs_glusterfs: always disable write-behind translator
      from  49710332b59 s3: modules: gluster. Fix the error I made in 
preventing talloc leaks from a function.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-11-test


- Log -----------------------------------------------------------------
commit f1b1dc12abaecbdef68f752d9a424180b0e6890d
Author: Günther Deschner <g...@samba.org>
Date:   Tue Nov 24 15:38:41 2020 +0100

    vfs_glusterfs: print exact cmdline for disabling write-behind translator
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14486
    
    Guenther
    
    Signed-off-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Anoop C S <anoo...@samba.org>
    
    Autobuild-User(master): Günther Deschner <g...@samba.org>
    Autobuild-Date(master): Fri Nov 27 17:15:07 UTC 2020 on sn-devel-184
    
    (cherry picked from commit 369c1d539837b70e94fe9d533d44860c8a9380a1)
    
    Autobuild-User(v4-11-test): Karolin Seeger <ksee...@samba.org>
    Autobuild-Date(v4-11-test): Wed Dec  2 16:04:24 UTC 2020 on sn-devel-184

commit eb525a3e0704595550a130ae865304a90f22b0f8
Author: Anoop C S <anoo...@samba.org>
Date:   Thu Nov 5 16:12:09 2020 +0530

    manpages/vfs_glusterfs: Mention silent skipping of write-behind translator
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14486
    
    Signed-off-by: Anoop C S <anoo...@samba.org>
    Reviewed-by: Andrew Bartlett <abart...@samba.org>
    Reviewed-by: Guenther Deschner <g...@samba.org>
    
    Autobuild-User(master): Günther Deschner <g...@samba.org>
    Autobuild-Date(master): Mon Nov  9 13:30:06 UTC 2020 on sn-devel-184
    
    (cherry picked from commit be03ce7d8bb213633eedcfc3299b8d9865a3c67f)

commit d6fb44cba256ce98feea3dc968653ca22aa715bd
Author: Günther Deschner <g...@samba.org>
Date:   Mon Nov 2 16:10:44 2020 +0100

    s3-vfs_glusterfs: always disable write-behind translator
    
    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 <g...@samba.org>
    Pair-Programmed-With: Anoop C S <anoo...@samba.org>
    Pair-Programmed-With: Sachin Prabhu <spra...@redhat.com>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@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 <ksee...@samba.org>
    Autobuild-Date(v4-13-test): Thu Nov  5 13:54:25 UTC 2020 on sn-devel-184

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages/vfs_glusterfs.8.xml |  9 +++++++++
 source3/modules/vfs_glusterfs.c       | 27 ++++++++++++++++++++++-----
 source3/wscript                       |  3 +++
 3 files changed, 34 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_glusterfs.8.xml 
b/docs-xml/manpages/vfs_glusterfs.8.xml
index 7a4da1af919..d25135e14ac 100644
--- a/docs-xml/manpages/vfs_glusterfs.8.xml
+++ b/docs-xml/manpages/vfs_glusterfs.8.xml
@@ -179,7 +179,16 @@
                 translator and refuse to connect if detected.
                 Please disable the write-behind translator for the GlusterFS
                 volume to allow the plugin to connect to the volume.
+                The write-behind translator can easily be disabled via calling
+                <programlisting>
+                        gluster volume set &lt;volumename&gt; 
performance.write-behind off
+                </programlisting> on the commandline.
        </para>
+        <para>
+                With GlusterFS versions >= 9, we silently bypass write-behind
+                translator during initial connect and failure is avoided.
+        </para>
+
 </refsect1>
 
 
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index 190235cf8ae..ce31b5eba14 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -345,9 +345,12 @@ static int check_for_write_behind_translator(TALLOC_CTX 
*mem_ctx,
        if (write_behind_present) {
                DBG_ERR("Write behind translator is enabled for "
                        "volume (%s), refusing to connect! "
-                       "Please check the vfs_glusterfs(8) manpage for "
+                       "Please turn off the write behind translator by calling 
"
+                       "'gluster volume set %s performance.write-behind off' "
+                       "on the commandline. "
+                       "Check the vfs_glusterfs(8) manpage for "
                        "further details.\n",
-                       volume);
+                       volume, volume);
                return -1;
        }
 
@@ -365,6 +368,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 +428,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 +453,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);
diff --git a/source3/wscript b/source3/wscript
index 7b257bcb845..47f97c60321 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -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')


-- 
Samba Shared Repository

Reply via email to