[SCM] Samba Shared Repository - branch v4-11-stable updated

Karolin Seeger kseeger at samba.org
Thu Dec 3 07:39:04 UTC 2020


The branch, v4-11-stable has been updated
       via  99f4a3daa25 VERSION: Disable GIT_SNAPSHOT for the 4.11.17 release.
       via  1c76f331a69 WHATSNEW: Add release notes for Samba 4.11.17.
       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
       via  49710332b59 s3: modules: gluster. Fix the error I made in preventing talloc leaks from a function.
       via  09da9690e93 VERSION: Bump version up to 4.11.17...
      from  9c32d5a99c1 VERSION: Disable GIT_SNAPSHOT for the 4.11.16 release.

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


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                               |  2 +-
 WHATSNEW.txt                          | 52 +++++++++++++++++++++++++++++++++--
 docs-xml/manpages/vfs_glusterfs.8.xml |  9 ++++++
 source3/modules/vfs_glusterfs.c       | 47 ++++++++++++++++++++++---------
 source3/wscript                       |  3 ++
 5 files changed, 97 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index d9245529268..64eda0f3add 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=11
-SAMBA_VERSION_RELEASE=16
+SAMBA_VERSION_RELEASE=17
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 914e3cc3bf9..b8b5c0009af 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,3 +1,51 @@
+                   ===============================
+                   Release Notes for Samba 4.11.17
+                          December 03, 2020
+                   ===============================
+
+
+This is an extraordinary release of the Samba 4.11 release series to fix a
+regression introduced with Samba 4.11.16.
+
+
+Changes since 4.11.16
+---------------------
+
+o  Jeremy Allison <jra at samba.org>
+   * BUG 14486: s3: vfs_glusterfs: Fix the error in preventing talloc leaks from
+     a function.
+
+o  Günther Deschner <gd at samba.org>
+   * BUG 14486: s3-vfs_glusterfs: Always disable write-behind translator.
+
+o  Anoop C S <anoopcs at samba.org>
+   * BUG 14486: manpages/vfs_glusterfs: Mention silent skipping of write-behind
+     translator.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the Samba 4.1 and newer product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
                    ===============================
                    Release Notes for Samba 4.11.16
                           November 04, 2020
@@ -67,8 +115,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
 
                    ===============================
                    Release Notes for Samba 4.11.15
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 <volumename> 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 747176ecebb..ce31b5eba14 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -315,15 +315,25 @@ static int check_for_write_behind_translator(TALLOC_CTX *mem_ctx,
 		return -1;
 	}
 
+	/*
+	 * file_lines_parse() plays horrible tricks with
+	 * the passed-in talloc pointers and the hierarcy
+	 * which makes freeing hard to get right.
+	 *
+	 * As we know mem_ctx is freed by the caller, after
+	 * this point don't free on exit and let the caller
+	 * handle it. This violates good Samba coding practice
+	 * but we know we're not leaking here.
+	 */
+
 	lines = file_lines_parse(buf,
 				newlen,
 				&numlines,
 				mem_ctx);
 	if (lines == NULL || numlines <= 0) {
-		TALLOC_FREE(option);
-		TALLOC_FREE(buf);
 		return -1;
 	}
+	/* On success, buf is now a talloc child of lines !! */
 
 	for (i=0; i < numlines; i++) {
 		if (strequal(lines[i], option)) {
@@ -335,18 +345,15 @@ 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);
-		TALLOC_FREE(lines);
-		TALLOC_FREE(option);
-		TALLOC_FREE(buf);
+			volume, volume);
 		return -1;
 	}
 
-	TALLOC_FREE(lines);
-	TALLOC_FREE(option);
-	TALLOC_FREE(buf);
 	return 0;
 }
 
@@ -361,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) {
@@ -420,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",
@@ -434,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



More information about the samba-cvs mailing list