[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Dec 17 15:45:03 MST 2013


The branch, master has been updated
       via  078c868 vfs_glusterfs: Enable per client log file
      from  fdccaab ctdb/eventscripts: Do not reconfigure in "monitor" events

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 078c86810f6d3a9c800e00e818531c1df164f763
Author: Poornima Gurusiddaiah <pgurusid at redhat.com>
Date:   Fri Nov 22 05:04:11 2013 +0000

    vfs_glusterfs: Enable per client log file
    
    In Samba configuration file, one of the options of gluster type is
    log file, the value of this option was not allowed to contain any
    variables, as a result all the clients would have a single log file,
    which complicated debugging.
    In this patch, variable substitution is performed for gluster log file.
    Hence allowing user to customise the gluster log file name.
    
    Signed-off-by: Poornima Gurusiddaiah <pgurusid at redhat.com>
    Reviewed-by: Ira Cooper <ira at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Dec 17 23:44:16 CET 2013 on sn-devel-104

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

Summary of changes:
 source3/modules/vfs_glusterfs.c |   49 +++++++++++++++++++++++----------------
 1 files changed, 29 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index ca7d790..3262f11 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -209,12 +209,18 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
 {
 	const char *volfile_server;
 	const char *volume;
-	const char *logfile;
+	char *logfile;
 	int loglevel;
-	glfs_t *fs;
-	int ret;
+	glfs_t *fs = NULL;
+	TALLOC_CTX *tmp_ctx;
+	int ret = 0;
 
-	logfile = lp_parm_const_string(SNUM(handle->conn), "glusterfs",
+	tmp_ctx = talloc_new(NULL);
+	if (tmp_ctx == NULL) {
+		ret = -1;
+		goto done;
+	}
+	logfile = lp_parm_talloc_string(tmp_ctx, SNUM(handle->conn), "glusterfs",
 				       "logfile", NULL);
 
 	loglevel = lp_parm_int(SNUM(handle->conn), "glusterfs", "loglevel", -1);
@@ -233,57 +239,60 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
 
 	fs = glfs_find_preopened(volume);
 	if (fs) {
-		goto found;
+		goto done;
 	}
 
 	fs = glfs_new(volume);
 	if (fs == NULL) {
-		return -1;
+		ret = -1;
+		goto done;
 	}
 
 	ret = glfs_set_volfile_server(fs, "tcp", volfile_server, 0);
 	if (ret < 0) {
 		DEBUG(0, ("Failed to set volfile_server %s\n", volfile_server));
-		glfs_fini(fs);
-		return -1;
+		goto done;
 	}
 
 	ret = glfs_set_xlator_option(fs, "*-md-cache", "cache-posix-acl",
 				     "true");
 	if (ret < 0) {
 		DEBUG(0, ("%s: Failed to set xlator options\n", volume));
-		glfs_fini(fs);
-		return -1;
+		goto done;
 	}
 
 	ret = glfs_set_logging(fs, logfile, loglevel);
 	if (ret < 0) {
 		DEBUG(0, ("%s: Failed to set logfile %s loglevel %d\n",
 			  volume, logfile, loglevel));
-		glfs_fini(fs);
-		return -1;
+		goto done;
 	}
 
 	ret = glfs_init(fs);
 	if (ret < 0) {
 		DEBUG(0, ("%s: Failed to initialize volume (%s)\n",
 			  volume, strerror(errno)));
-		glfs_fini(fs);
-		return -1;
+		goto done;
 	}
 
 	ret = glfs_set_preopened(volume, fs);
 	if (ret < 0) {
 		DEBUG(0, ("%s: Failed to register volume (%s)\n",
 			  volume, strerror(errno)));
-		glfs_fini(fs);
+		goto done;
+	}
+done:
+	talloc_free(tmp_ctx);
+	if (ret < 0) {
+		if (fs)
+			glfs_fini(fs);
 		return -1;
+	} else {
+		DEBUG(0, ("%s: Initialized volume from server %s\n",
+                         volume, volfile_server));
+		handle->data = fs;
+		return 0;
 	}
-found:
-	DEBUG(0, ("%s: Initialized volume from server %s\n",
-		  volume, volfile_server));
-	handle->data = fs;
-	return 0;
 }
 
 static void vfs_gluster_disconnect(struct vfs_handle_struct *handle)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list