[SCM] Samba Shared Repository - branch master updated

Ralph Böhme slow at samba.org
Fri Aug 12 19:04:03 UTC 2016


The branch, master has been updated
       via  89a2462 vfs_gpfs: Load nfs4 acl params at tcon time
       via  519b10e nfs4acls: Allow nfs4 acl params to be set by callers
       via  d982ea5 nfs4acls: Make smbacl4_vfs_params public
       via  e3523c8 nfs4acls: Add "smbacl4_vfs_params" parameter to smb_set_nt_acl_nfs4
       via  02882b4 nfs4acls: Add "smbacl4_vfs_params" parameter to smb_get_nt_acl_nfs4
       via  fbddf56 nfs4acls: Add "smbacl4_vfs_params" parameter to smb_fget_nt_acl_nfs4
       via  41bb898 nfs4acls: Add some const
       via  baaf4e3 nfs4acls: Remove a typedef
      from  e7ad872 KCC: Fix misnamed variable in DSA object

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


- Log -----------------------------------------------------------------
commit 89a24622e738c5e31042e299d93682789d80f4fe
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 11:38:43 2016 +0200

    vfs_gpfs: Load nfs4 acl params at tcon time
    
    This reduces user-space CPU for metadata intensive workloads, lp_parm_* is
    expensive doing lots of strwicmp.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Fri Aug 12 21:03:36 CEST 2016 on sn-devel-144

commit 519b10e224356055474a5a03546ccd2479e16db2
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 11:31:12 2016 +0200

    nfs4acls: Allow nfs4 acl params to be set by callers
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit d982ea5246a90b630a5e1e51accc04f3690e2429
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 11:28:30 2016 +0200

    nfs4acls: Make smbacl4_vfs_params public
    
    vfs_gpfs & others will be able to embed this structure in their special config.
    
    We could have gone with an anonymous struct and a talloc'ed object, but for my
    taste this is specialized and hidden enough that it's not worth the
    indirection.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit e3523c8d46989ce078b31e212e44952db600ec5e
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 11:07:38 2016 +0200

    nfs4acls: Add "smbacl4_vfs_params" parameter to smb_set_nt_acl_nfs4
    
    Pure placeholder right now, this will allow vfs modules to load the params in
    advance
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 02882b44df9653ac1378bc1d7e279f03b370477c
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 11:07:38 2016 +0200

    nfs4acls: Add "smbacl4_vfs_params" parameter to smb_get_nt_acl_nfs4
    
    Pure placeholder right now, this will allow vfs modules to load the params in
    advance
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit fbddf56f17ab0c1cc669e381588e868c23d16fbc
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 11:07:38 2016 +0200

    nfs4acls: Add "smbacl4_vfs_params" parameter to smb_fget_nt_acl_nfs4
    
    Pure placeholder right now, this will allow vfs modules to load the params
    in advance. nfs4 acl parameters should not change while a tcon is live,
    and lp_parm_get_* show up in profiles. Loading the parameters once at
    tcon time will remove this.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 41bb898d0a80079019622c65057132016b19171a
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 09:10:19 2016 +0200

    nfs4acls: Add some const
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit baaf4e393bed859fd69bb63c814ed00aaac5e3c1
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Aug 9 09:07:13 2016 +0200

    nfs4acls: Remove a typedef
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

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

Summary of changes:
 source3/modules/nfs4_acls.c         | 70 ++++++++++++++++++-------------------
 source3/modules/nfs4_acls.h         | 16 +++++++++
 source3/modules/vfs_aixacl2.c       |  5 +--
 source3/modules/vfs_gpfs.c          | 21 +++++++++--
 source3/modules/vfs_nfs4acl_xattr.c |  9 ++---
 source3/modules/vfs_zfsacl.c        |  6 ++--
 6 files changed, 81 insertions(+), 46 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 8756285..71f4d8d 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -51,23 +51,11 @@ struct SMB4ACL_T
 	struct SMB4ACE_T	*last;
 };
 
-enum smbacl4_mode_enum {e_simple=0, e_special=1};
-enum smbacl4_acedup_enum {e_dontcare=0, e_reject=1, e_ignore=2, e_merge=3};
-
-typedef struct _smbacl4_vfs_params {
-	enum smbacl4_mode_enum mode;
-	bool do_chown;
-	enum smbacl4_acedup_enum acedup;
-	bool map_full_control;
-} smbacl4_vfs_params;
-
 /*
  * Gather special parameters for NFS4 ACL handling
  */
-static int smbacl4_get_vfs_params(
-	struct connection_struct *conn,
-	smbacl4_vfs_params *params
-)
+int smbacl4_get_vfs_params(struct connection_struct *conn,
+			   struct smbacl4_vfs_params *params)
 {
 	static const struct enum_list enum_smbacl4_modes[] = {
 		{ e_simple, "simple" },
@@ -303,7 +291,7 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, SMB_STRUCT_STAT *psbuf)
 }
 
 static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
-	smbacl4_vfs_params *params,
+	const struct smbacl4_vfs_params *params,
 	struct SMB4ACL_T *acl, /* in */
 	struct dom_sid *psid_owner, /* in */
 	struct dom_sid *psid_group, /* in */
@@ -472,7 +460,7 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
 }
 
 static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf,
-					   smbacl4_vfs_params *params,
+					   const struct smbacl4_vfs_params *params,
 					   uint32_t security_info,
 					   TALLOC_CTX *mem_ctx,
 					   struct security_descriptor **ppdesc,
@@ -533,13 +521,14 @@ static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf,
 }
 
 NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
+			      const struct smbacl4_vfs_params *pparams,
 			      uint32_t security_info,
 			      TALLOC_CTX *mem_ctx,
 			      struct security_descriptor **ppdesc,
 			      struct SMB4ACL_T *theacl)
 {
 	SMB_STRUCT_STAT sbuf;
-	smbacl4_vfs_params params;
+	struct smbacl4_vfs_params params;
 
 	DEBUG(10, ("smb_fget_nt_acl_nfs4 invoked for %s\n", fsp_str_dbg(fsp)));
 
@@ -547,24 +536,28 @@ NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
 		return map_nt_error_from_unix(errno);
 	}
 
-	/* Special behaviours */
-	if (smbacl4_get_vfs_params(fsp->conn, &params)) {
-		return NT_STATUS_NO_MEMORY;
+	if (pparams == NULL) {
+		/* Special behaviours */
+		if (smbacl4_get_vfs_params(fsp->conn, &params)) {
+			return NT_STATUS_NO_MEMORY;
+		}
+		pparams = ¶ms;
 	}
 
-	return smb_get_nt_acl_nfs4_common(&sbuf, &params, security_info,
+	return smb_get_nt_acl_nfs4_common(&sbuf, pparams, security_info,
 					  mem_ctx, ppdesc, theacl);
 }
 
 NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
 			     const struct smb_filename *smb_fname,
+			     const struct smbacl4_vfs_params *pparams,
 			     uint32_t security_info,
 			     TALLOC_CTX *mem_ctx,
 			     struct security_descriptor **ppdesc,
 			     struct SMB4ACL_T *theacl)
 {
 	SMB_STRUCT_STAT sbuf;
-	smbacl4_vfs_params params;
+	struct smbacl4_vfs_params params;
 
 	DEBUG(10, ("smb_get_nt_acl_nfs4 invoked for %s\n",
 		smb_fname->base_name));
@@ -573,12 +566,15 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
 		return map_nt_error_from_unix(errno);
 	}
 
-	/* Special behaviours */
-	if (smbacl4_get_vfs_params(conn, &params)) {
-		return NT_STATUS_NO_MEMORY;
+	if (pparams == NULL) {
+		/* Special behaviours */
+		if (smbacl4_get_vfs_params(conn, &params)) {
+			return NT_STATUS_NO_MEMORY;
+		}
+		pparams = ¶ms;
 	}
 
-	return smb_get_nt_acl_nfs4_common(&sbuf, &params, security_info,
+	return smb_get_nt_acl_nfs4_common(&sbuf, pparams, security_info,
 					  mem_ctx, ppdesc, theacl);
 }
 
@@ -648,7 +644,7 @@ static SMB_ACE4PROP_T *smbacl4_find_equal_special(
 
 static bool smbacl4_fill_ace4(
 	const struct smb_filename *filename,
-	smbacl4_vfs_params *params,
+	const struct smbacl4_vfs_params *params,
 	uid_t ownerUID,
 	gid_t ownerGID,
 	const struct security_ace *ace_nt, /* input */
@@ -853,7 +849,7 @@ static struct SMB4ACL_T *smbacl4_win2nfs4(
 	TALLOC_CTX *mem_ctx,
 	const files_struct *fsp,
 	const struct security_acl *dacl,
-	smbacl4_vfs_params *pparams,
+	const struct smbacl4_vfs_params *pparams,
 	uid_t ownerUID,
 	gid_t ownerGID
 )
@@ -903,11 +899,12 @@ static struct SMB4ACL_T *smbacl4_win2nfs4(
 }
 
 NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
+	const struct smbacl4_vfs_params *pparams,
 	uint32_t security_info_sent,
 	const struct security_descriptor *psd,
 	set_nfs4acl_native_fn_t set_nfs4_native)
 {
-	smbacl4_vfs_params params;
+	struct smbacl4_vfs_params params;
 	struct SMB4ACL_T *theacl = NULL;
 	bool	result;
 
@@ -930,10 +927,13 @@ NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
 				      * refined... */
 	}
 
-	/* Special behaviours */
-	if (smbacl4_get_vfs_params(fsp->conn, &params)) {
-		TALLOC_FREE(frame);
-		return NT_STATUS_NO_MEMORY;
+	if (pparams == NULL) {
+		/* Special behaviours */
+		if (smbacl4_get_vfs_params(fsp->conn, &params)) {
+			TALLOC_FREE(frame);
+			return NT_STATUS_NO_MEMORY;
+		}
+		pparams = ¶ms;
 	}
 
 	if (smbacl4_fGetFileOwner(fsp, &sbuf)) {
@@ -941,7 +941,7 @@ NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
 		return map_nt_error_from_unix(errno);
 	}
 
-	if (params.do_chown) {
+	if (pparams->do_chown) {
 		/* chown logic is a copy/paste from posix_acl.c:set_nt_acl */
 		NTSTATUS status = unpack_nt_owners(fsp->conn, &newUID, &newGID,
 						   security_info_sent, psd);
@@ -988,7 +988,7 @@ NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
 		return NT_STATUS_OK;
 	}
 
-	theacl = smbacl4_win2nfs4(frame, fsp, psd->dacl, &params,
+	theacl = smbacl4_win2nfs4(frame, fsp, psd->dacl, pparams,
 				  sbuf.st_ex_uid, sbuf.st_ex_gid);
 	if (!theacl) {
 		TALLOC_FREE(frame);
diff --git a/source3/modules/nfs4_acls.h b/source3/modules/nfs4_acls.h
index 588e8ea..ba6761d 100644
--- a/source3/modules/nfs4_acls.h
+++ b/source3/modules/nfs4_acls.h
@@ -110,6 +110,19 @@ typedef struct _SMB_ACE4PROP_T {
 struct SMB4ACL_T;
 struct SMB4ACE_T;
 
+enum smbacl4_mode_enum {e_simple=0, e_special=1};
+enum smbacl4_acedup_enum {e_dontcare=0, e_reject=1, e_ignore=2, e_merge=3};
+
+struct smbacl4_vfs_params {
+	enum smbacl4_mode_enum mode;
+	bool do_chown;
+	enum smbacl4_acedup_enum acedup;
+	bool map_full_control;
+};
+
+int smbacl4_get_vfs_params(struct connection_struct *conn,
+			   struct smbacl4_vfs_params *params);
+
 struct SMB4ACL_T *smb_create_smb4acl(TALLOC_CTX *mem_ctx);
 
 /* prop's contents are copied */
@@ -131,12 +144,14 @@ uint16_t smbacl4_get_controlflags(struct SMB4ACL_T *theacl);
 bool smbacl4_set_controlflags(struct SMB4ACL_T *theacl, uint16_t controlflags);
 
 NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp,
+	const struct smbacl4_vfs_params *pparams,
 	uint32_t security_info,
 	TALLOC_CTX *mem_ctx,
 	struct security_descriptor **ppdesc, struct SMB4ACL_T *theacl);
 
 NTSTATUS smb_get_nt_acl_nfs4(connection_struct *conn,
 	const struct smb_filename *smb_fname,
+	const struct smbacl4_vfs_params *pparams,
 	uint32_t security_info,
 	TALLOC_CTX *mem_ctx,
 	struct security_descriptor **ppdesc, struct SMB4ACL_T *theacl);
@@ -148,6 +163,7 @@ typedef bool (*set_nfs4acl_native_fn_t)(vfs_handle_struct *handle,
 					struct SMB4ACL_T *);
 
 NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
+	const struct smbacl4_vfs_params *pparams,
 	uint32_t security_info_sent,
 	const struct security_descriptor *psd,
 	set_nfs4acl_native_fn_t set_nfs4_native);
diff --git a/source3/modules/vfs_aixacl2.c b/source3/modules/vfs_aixacl2.c
index 1c9f84b..c4a0264 100644
--- a/source3/modules/vfs_aixacl2.c
+++ b/source3/modules/vfs_aixacl2.c
@@ -179,7 +179,7 @@ static NTSTATUS aixjfs2_fget_nt_acl(vfs_handle_struct *handle,
 		return NT_STATUS_ACCESS_DENIED;
 	}
 
-	status = smb_fget_nt_acl_nfs4(fsp, security_info, ppdesc,
+	status = smb_fget_nt_acl_nfs4(fsp, NULL, security_info, ppdesc,
 				      mem_ctx, pacl);
 	TALLOC_FREE(frame);
 	return status;
@@ -214,6 +214,7 @@ static NTSTATUS aixjfs2_get_nt_acl(vfs_handle_struct *handle,
 
 	return smb_get_nt_acl_nfs4(handle->conn,
 				smb_fname,
+				NULL,
 				security_info,
 				mem_ctx,
 				ppdesc,
@@ -445,7 +446,7 @@ static NTSTATUS aixjfs2_set_nt_acl_common(vfs_handle_struct *handle, files_struc
 	if (rc==0)
 	{
 		result = smb_set_nt_acl_nfs4(handle,
-			fsp, security_info_sent, psd,
+			fsp, NULL, security_info_sent, psd,
 			aixjfs2_process_smbacl);
 	} else if (rc==1) { /* assume POSIX ACL - by default... */
 		result = set_nt_acl(fsp, security_info_sent, psd);
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index f096dd5..730dda2 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -39,6 +39,7 @@
 #endif
 
 struct gpfs_config_data {
+	struct smbacl4_vfs_params nfs4_params;
 	bool sharemodes;
 	bool leases;
 	bool hsm;
@@ -589,8 +590,9 @@ static NTSTATUS gpfsacl_fget_nt_acl(vfs_handle_struct *handle,
 	result = gpfs_get_nfs4_acl(frame, fsp->fsp_name->base_name, &pacl);
 
 	if (result == 0) {
-		status = smb_fget_nt_acl_nfs4(fsp, security_info, mem_ctx,
-					      ppdesc, pacl);
+		status = smb_fget_nt_acl_nfs4(fsp, &config->nfs4_params,
+					      security_info,
+					      mem_ctx, ppdesc, pacl);
 		TALLOC_FREE(frame);
 		return status;
 	}
@@ -639,6 +641,7 @@ static NTSTATUS gpfsacl_get_nt_acl(vfs_handle_struct *handle,
 
 	if (result == 0) {
 		status = smb_get_nt_acl_nfs4(handle->conn, smb_fname,
+					     &config->nfs4_params,
 					     security_info, mem_ctx, ppdesc,
 					     pacl);
 		TALLOC_FREE(frame);
@@ -801,6 +804,8 @@ static NTSTATUS gpfsacl_set_nt_acl_internal(vfs_handle_struct *handle, files_str
 	}
 
 	if (acl->acl_version == GPFS_ACL_VERSION_NFS4) {
+		struct gpfs_config_data *config;
+
 		if (lp_parm_bool(fsp->conn->params->service, "gpfs",
 				 "refuse_dacl_protected", false)
 		    && (psd->type&SEC_DESC_DACL_PROTECTED)) {
@@ -809,8 +814,12 @@ static NTSTATUS gpfsacl_set_nt_acl_internal(vfs_handle_struct *handle, files_str
 			return NT_STATUS_NOT_SUPPORTED;
 		}
 
+		SMB_VFS_HANDLE_GET_DATA(handle, config,
+					struct gpfs_config_data,
+					return NT_STATUS_INTERNAL_ERROR);
+
 		result = smb_set_nt_acl_nfs4(handle,
-			fsp, security_info_sent, psd,
+			fsp, &config->nfs4_params, security_info_sent, psd,
 			gpfsacl_process_smbacl);
 	} else { /* assume POSIX ACL - by default... */
 		result = set_nt_acl(fsp, security_info_sent, psd);
@@ -2080,6 +2089,12 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle,
 		return ret;
 	}
 
+	ret = smbacl4_get_vfs_params(handle->conn, &config->nfs4_params);
+	if (ret < 0) {
+		TALLOC_FREE(config);
+		return ret;
+	}
+
 	config->sharemodes = lp_parm_bool(SNUM(handle->conn), "gpfs",
 					"sharemodes", true);
 
diff --git a/source3/modules/vfs_nfs4acl_xattr.c b/source3/modules/vfs_nfs4acl_xattr.c
index 9ab7238..273c926 100644
--- a/source3/modules/vfs_nfs4acl_xattr.c
+++ b/source3/modules/vfs_nfs4acl_xattr.c
@@ -336,7 +336,7 @@ static NTSTATUS nfs4_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
 			   uint32_t security_info_sent,
 			   const struct security_descriptor *psd)
 {
-	return smb_set_nt_acl_nfs4(handle, fsp, security_info_sent, psd,
+	return smb_set_nt_acl_nfs4(handle, fsp, NULL, security_info_sent, psd,
 			nfs4acl_xattr_fset_smb4acl);
 }
 
@@ -535,7 +535,8 @@ static NTSTATUS nfs4acl_xattr_fget_nt_acl(struct vfs_handle_struct *handle,
 		return status;
 	}
 
-	status = smb_fget_nt_acl_nfs4(fsp, security_info, mem_ctx, ppdesc, pacl);
+	status = smb_fget_nt_acl_nfs4(fsp, NULL, security_info, mem_ctx,
+				      ppdesc, pacl);
 	TALLOC_FREE(frame);
 	return status;
 }
@@ -560,8 +561,8 @@ static NTSTATUS nfs4acl_xattr_get_nt_acl(struct vfs_handle_struct *handle,
 		return status;
 	}
 
-	status = smb_get_nt_acl_nfs4(handle->conn, smb_fname, security_info,
-				     mem_ctx, ppdesc,
+	status = smb_get_nt_acl_nfs4(handle->conn, smb_fname, NULL,
+				     security_info, mem_ctx, ppdesc,
 				     pacl);
 	TALLOC_FREE(frame);
 	return status;
diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c
index 18f1356..a0993ff 100644
--- a/source3/modules/vfs_zfsacl.c
+++ b/source3/modules/vfs_zfsacl.c
@@ -187,7 +187,7 @@ static NTSTATUS zfs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
 			   uint32_t security_info_sent,
 			   const struct security_descriptor *psd)
 {
-        return smb_set_nt_acl_nfs4(handle, fsp, security_info_sent, psd,
+        return smb_set_nt_acl_nfs4(handle, fsp, NULL, security_info_sent, psd,
 				   zfs_process_smbacl);
 }
 
@@ -209,7 +209,8 @@ static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle,
 		return status;
 	}
 
-	status = smb_fget_nt_acl_nfs4(fsp, security_info, mem_ctx, ppdesc, pacl);
+	status = smb_fget_nt_acl_nfs4(fsp, NULL, security_info, mem_ctx,
+				      ppdesc, pacl);
 	TALLOC_FREE(frame);
 	return status;
 }
@@ -234,6 +235,7 @@ static NTSTATUS zfsacl_get_nt_acl(struct vfs_handle_struct *handle,
 
 	status = smb_get_nt_acl_nfs4(handle->conn,
 					smb_fname,
+					NULL,
 					security_info,
 					mem_ctx,
 					ppdesc,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list