[PATCH] vfs_glusterfs: Enable per client log file

Andreas Schneider asn at samba.org
Fri Oct 18 06:35:42 MDT 2013


On Friday 18 October 2013 06:51:23 Poornima Gurusiddaiah wrote:

Could you please do some modifications to your patch?

> +extern userdom_struct current_user_info;
> +

Please remove this.
 
>  /* Helpers to provide 'integer' fds */
>  
>  /* This is global. gfapi's FD operations do not
> 
> @@ -205,13 +207,17 @@ static int vfs_gluster_connect(struct
> vfs_handle_struct *handle,> 
>  {
>  
>  	const char *volfile_server;
>  	const char *volume;
> 
> -	const char *logfile;
> +	const char *logfile_nosub;
> +	char logfile[PATH_MAX] = {0,};

	You can remove the , here. ^

> 
>  	int loglevel;
>  	glfs_t *fs;
>  	int ret;
> 
> -	logfile = lp_parm_const_string(SNUM(handle->conn), "glusterfs",
> +	logfile_nosub = lp_parm_const_string(SNUM(handle->conn), "glusterfs",
> 
>  				       "logfile", NULL);
> 
> +	strncpy(logfile, logfile_nosub, (PATH_MAX-1));
> +	logfile[PATH_MAX] = '\0';
> +	standard_sub_basic(get_current_username(), current_user_info.domain,
> logfile, (PATH_MAX-1));

Please implement a get_current_domain() like get_current_username() cause we 
will try to get rid of the globals in future and using a function means we 
need to touch less code.

Also I would suggest to use sizeof(logfile) - 1 instead of PATH_MAX here.

>  	loglevel = lp_parm_int(SNUM(handle->conn), "glusterfs", "loglevel", -1);


Cheers,


	-- andreas

-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list