[SCM] Samba Shared Repository - branch master updated

Christian Ambach ambi at samba.org
Fri Feb 10 12:15:03 MST 2012


The branch, master has been updated
       via  e87d98c s3:vfs_gpfs:quieten an expectable warning message
       via  4a11be3 s3:vfs_gpfs: fix a compiler warning
       via  8ce9982 s3:vfs_gpfs:Fix query of creation time from GPFS
       via  318346a s3:vfs_gpfs: make "gpfs:getrealfilename" a per share option
       via  8ad2b6a s3:vfs_gpfs: make "gpfs:ftruncate" a per share option
       via  89a4f66 s3:vfs_gpfs: make "gpfs:winattr" a per share option
       via  2e95d80 s3:vfs_gpfs: be less verbose in get/set_xattr functions
      from  f1db715 s3-smb2: Use the correct indicator if a request was deferred

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


- Log -----------------------------------------------------------------
commit e87d98c0fcf439a65031b072bebe0fed296cf59e
Author: Christian Ambach <ambi at samba.org>
Date:   Fri Feb 10 18:15:56 2012 +0100

    s3:vfs_gpfs:quieten an expectable warning message
    
    Autobuild-User: Christian Ambach <ambi at samba.org>
    Autobuild-Date: Fri Feb 10 20:14:12 CET 2012 on sn-devel-104

commit 4a11be3fb4d2cdcae323fc7932371eecca56b3cd
Author: Christian Ambach <ambi at samba.org>
Date:   Fri Feb 10 18:11:30 2012 +0100

    s3:vfs_gpfs: fix a compiler warning

commit 8ce9982be9dac71bbfc109e7f0c43aec94850c89
Author: Christof Schmitt <christof.schmitt at us.ibm.com>
Date:   Tue Nov 29 13:23:29 2011 -0700

    s3:vfs_gpfs:Fix query of creation time from GPFS
    
    Setting the creation time through SetFileTime on a GPFS file system and
    querying it with GetFileTime shows a mismatch.
    
    The vfs_gpfs module first retrieves the information from the operating
    system and the flag st_ex_calculated_birthtime is set to false. When
    vfs_gpfs retrieves the birthtime from GPFS the flag
    st_ex_calculated_birthtime has to be set to true. Otherwise the birth
    time will get overwritten by a call to update_stat_ex_mtime, reporting
    the wrong time to a client system.
    
    Signed-off-by: Christian Ambach <ambi at samba.org>

commit 318346a9373df9b16c436b8539362ff8d341960e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Dec 22 15:54:41 2011 +0100

    s3:vfs_gpfs: make "gpfs:getrealfilename" a per share option
    
    metze
    
    Signed-off-by: Christian Ambach <ambi at samba.org>

commit 8ad2b6a55e23922570659a4e4fb88e1b7d710772
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Dec 22 15:54:41 2011 +0100

    s3:vfs_gpfs: make "gpfs:ftruncate" a per share option
    
    metze
    
    Signed-off-by: Christian Ambach <ambi at samba.org>

commit 89a4f66826a2e614bd782dcaff72ea3650229142
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Dec 22 14:36:55 2011 +0100

    s3:vfs_gpfs: make "gpfs:winattr" a per share option
    
    metze
    
    Signed-off-by: Christian Ambach <ambi at samba.org>

commit 2e95d8048b9e9c7025ddada7ede15494e6016ba9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Dec 22 14:20:32 2011 +0100

    s3:vfs_gpfs: be less verbose in get/set_xattr functions
    
    metze
    
    Signed-off-by: Christian Ambach <ambi at samba.org>

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

Summary of changes:
 source3/modules/gpfs.c     |   20 ++------
 source3/modules/vfs_gpfs.c |  113 ++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 114 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c
index d73b94b..5ce2381 100644
--- a/source3/modules/gpfs.c
+++ b/source3/modules/gpfs.c
@@ -25,10 +25,6 @@
 #include "gpfs_gpl.h"
 #include "vfs_gpfs.h"
 
-static bool gpfs_getrealfilename;
-static bool gpfs_winattr;
-static bool gpfs_do_ftruncate;
-
 static int (*gpfs_set_share_fn)(int fd, unsigned int allow, unsigned int deny);
 static int (*gpfs_set_lease_fn)(int fd, unsigned int leaseType);
 static int (*gpfs_getacl_fn)(char *pathname, int flags, void *acl);
@@ -136,7 +132,7 @@ int smbd_gpfs_putacl(char *pathname, int flags, void *acl)
 
 int smbd_gpfs_ftruncate(int fd, gpfs_off64_t length)
 {
-	if (!gpfs_do_ftruncate || (gpfs_ftruncate_fn == NULL)) {
+	if (gpfs_ftruncate_fn == NULL) {
 		errno = ENOSYS;
 		return -1;
 	}
@@ -147,8 +143,7 @@ int smbd_gpfs_ftruncate(int fd, gpfs_off64_t length)
 int smbd_gpfs_get_realfilename_path(char *pathname, char *filenamep,
 				    int *buflen)
 {
-	if ((!gpfs_getrealfilename)
-	    || (gpfs_get_realfilename_path_fn == NULL)) {
+	if (gpfs_get_realfilename_path_fn == NULL) {
 		errno = ENOSYS;
 		return -1;
 	}
@@ -159,7 +154,7 @@ int smbd_gpfs_get_realfilename_path(char *pathname, char *filenamep,
 int get_gpfs_winattrs(char *pathname,struct gpfs_winattr *attrs)
 {
 
-        if ((!gpfs_winattr) || (gpfs_get_winattrs_path_fn == NULL)) {
+	if (gpfs_get_winattrs_path_fn == NULL) {
                 errno = ENOSYS;
                 return -1;
         }
@@ -170,7 +165,7 @@ int get_gpfs_winattrs(char *pathname,struct gpfs_winattr *attrs)
 int smbd_fget_gpfs_winattrs(int fd, struct gpfs_winattr *attrs)
 {
 
-        if ((!gpfs_winattr) || (gpfs_get_winattrs_fn == NULL)) {
+	if (gpfs_get_winattrs_fn == NULL) {
                 errno = ENOSYS;
                 return -1;
         }
@@ -180,7 +175,7 @@ int smbd_fget_gpfs_winattrs(int fd, struct gpfs_winattr *attrs)
 
 int set_gpfs_winattrs(char *pathname,int flags,struct gpfs_winattr *attrs)
 {
-        if ((!gpfs_winattr) || (gpfs_set_winattrs_path_fn == NULL)) {
+	if (gpfs_set_winattrs_path_fn == NULL) {
                 errno = ENOSYS;
                 return -1;
         }
@@ -264,10 +259,5 @@ void init_gpfs(void)
 	init_gpfs_function(&gpfs_ftruncate_fn, "gpfs_ftruncate");
         init_gpfs_function(&gpfs_lib_init_fn,"gpfs_lib_init");
 
-	gpfs_getrealfilename = lp_parm_bool(-1, "gpfs", "getrealfilename",
-					    True);
-	gpfs_winattr = lp_parm_bool(-1, "gpfs", "winattr", False);
-	gpfs_do_ftruncate = lp_parm_bool(-1, "gpfs", "ftruncate", True);
-
 	return;
 }
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index a588ed1..6a9d3d5 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -39,6 +39,9 @@ struct gpfs_config_data {
 	bool leases;
 	bool hsm;
 	bool syncio;
+	bool winattr;
+	bool ftruncate;
+	bool getrealfilename;
 };
 
 
@@ -123,6 +126,16 @@ static int vfs_gpfs_get_real_filename(struct vfs_handle_struct *handle,
 	char real_pathname[PATH_MAX+1];
 	int buflen;
 	bool mangled;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
+
+	if (!config->getrealfilename) {
+		return SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name,
+						      mem_ctx, found_name);
+	}
 
 	mangled = mangle_is_mangled(name, handle->conn->params);
 	if (mangled) {
@@ -946,12 +959,22 @@ static int gpfs_set_xattr(struct vfs_handle_struct *handle,  const char *path,
         unsigned int dosmode=0;
         struct gpfs_winattr attrs;
         int ret = 0;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
+
+	if (!config->winattr) {
+		DEBUG(10, ("gpfs_set_xattr:name is %s -> next\n",name));
+		return SMB_VFS_NEXT_SETXATTR(handle,path,name,value,size,flags);
+	}
 
         DEBUG(10, ("gpfs_set_xattr: %s \n",path));
 
         /* Only handle DOS Attributes */
         if (strcmp(name,SAMBA_XATTR_DOS_ATTRIB) != 0){
-		DEBUG(1, ("gpfs_set_xattr:name is %s\n",name));
+		DEBUG(5, ("gpfs_set_xattr:name is %s\n",name));
 		return SMB_VFS_NEXT_SETXATTR(handle,path,name,value,size,flags);
         }
 
@@ -1022,12 +1045,22 @@ static ssize_t gpfs_get_xattr(struct vfs_handle_struct *handle,  const char *pat
         unsigned int dosmode = 0;
         struct gpfs_winattr attrs;
         int ret = 0;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
+
+	if (!config->winattr) {
+		DEBUG(10, ("gpfs_get_xattr:name is %s -> next\n",name));
+		return SMB_VFS_NEXT_GETXATTR(handle,path,name,value,size);
+	}
 
         DEBUG(10, ("gpfs_get_xattr: %s \n",path));
 
         /* Only handle DOS Attributes */
         if (strcmp(name,SAMBA_XATTR_DOS_ATTRIB) != 0){
-                DEBUG(1, ("gpfs_get_xattr:name is %s\n",name));
+		DEBUG(5, ("gpfs_get_xattr:name is %s\n",name));
                 return SMB_VFS_NEXT_GETXATTR(handle,path,name,value,size);
         }
 
@@ -1075,11 +1108,21 @@ static int vfs_gpfs_stat(struct vfs_handle_struct *handle,
 	char *fname = NULL;
 	NTSTATUS status;
 	int ret;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
 
 	ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
 	if (ret == -1) {
 		return -1;
 	}
+
+	if (!config->winattr) {
+		return 0;
+	}
+
 	status = get_full_smb_filename(talloc_tos(), smb_fname, &fname);
 	if (!NT_STATUS_IS_OK(status)) {
 		errno = map_errno_from_nt_status(status);
@@ -1088,6 +1131,7 @@ static int vfs_gpfs_stat(struct vfs_handle_struct *handle,
 	ret = get_gpfs_winattrs(discard_const_p(char, fname), &attrs);
 	TALLOC_FREE(fname);
 	if (ret == 0) {
+		smb_fname->st.st_ex_calculated_birthtime = false;
 		smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
 		smb_fname->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
 		smb_fname->st.vfs_private = attrs.winAttrs;
@@ -1100,6 +1144,11 @@ static int vfs_gpfs_fstat(struct vfs_handle_struct *handle,
 {
 	struct gpfs_winattr attrs;
 	int ret;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
 
 	ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
 	if (ret == -1) {
@@ -1108,8 +1157,13 @@ static int vfs_gpfs_fstat(struct vfs_handle_struct *handle,
 	if ((fsp->fh == NULL) || (fsp->fh->fd == -1)) {
 		return 0;
 	}
+	if (!config->winattr) {
+		return 0;
+	}
+
 	ret = smbd_fget_gpfs_winattrs(fsp->fh->fd, &attrs);
 	if (ret == 0) {
+		sbuf->st_ex_calculated_birthtime = false;
 		sbuf->st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
 		sbuf->st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
 	}
@@ -1123,11 +1177,20 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle,
 	char *path = NULL;
 	NTSTATUS status;
 	int ret;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
 
 	ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname);
 	if (ret == -1) {
 		return -1;
 	}
+	if (!config->winattr) {
+		return 0;
+	}
+
 	status = get_full_smb_filename(talloc_tos(), smb_fname, &path);
 	if (!NT_STATUS_IS_OK(status)) {
 		errno = map_errno_from_nt_status(status);
@@ -1136,6 +1199,7 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle,
 	ret = get_gpfs_winattrs(discard_const_p(char, path), &attrs);
 	TALLOC_FREE(path);
 	if (ret == 0) {
+		smb_fname->st.st_ex_calculated_birthtime = false;
 		smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec;
 		smb_fname->st.st_ex_btime.tv_nsec = attrs.creationTime.tv_nsec;
 		smb_fname->st.vfs_private = attrs.winAttrs;
@@ -1152,10 +1216,19 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle,
         int ret;
         char *path = NULL;
         NTSTATUS status;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
 
         ret = SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
         if(ret == -1){
-                DEBUG(1,("vfs_gpfs_ntimes: SMB_VFS_NEXT_NTIMES failed\n"));
+		/* don't complain if access was denied */
+		if (errno != EPERM && errno != EACCES) {
+			DEBUG(1,("vfs_gpfs_ntimes: SMB_VFS_NEXT_NTIMES failed:"
+				 "%s", strerror(errno)));
+		}
                 return -1;
         }
 
@@ -1164,6 +1237,10 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle,
                 return 0;
         }
 
+	if (!config->winattr) {
+		return 0;
+	}
+
         status = get_full_smb_filename(talloc_tos(), smb_fname, &path);
         if (!NT_STATUS_IS_OK(status)) {
                 errno = map_errno_from_nt_status(status);
@@ -1188,6 +1265,15 @@ static int vfs_gpfs_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
 				SMB_OFF_T len)
 {
 	int result;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
+
+	if (!config->ftruncate) {
+		return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len);
+	}
 
 	result = smbd_gpfs_ftruncate(fsp->fh->fd, len);
 	if ((result == -1) && (errno == ENOSYS)) {
@@ -1203,6 +1289,15 @@ static bool vfs_gpfs_is_offline(struct vfs_handle_struct *handle,
 	struct gpfs_winattr attrs;
 	char *path = NULL;
 	NTSTATUS status;
+	struct gpfs_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct gpfs_config_data,
+				return -1);
+
+	if (!config->winattr) {
+		return SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
+	}
 
 	status = get_full_smb_filename(talloc_tos(), fname, &path);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -1252,10 +1347,11 @@ int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service,
 			const char *user)
 {
 	struct gpfs_config_data *config;
+	int ret;
 
 	smbd_gpfs_lib_init();
 
-	int ret = SMB_VFS_NEXT_CONNECT(handle, service, user);
+	ret = SMB_VFS_NEXT_CONNECT(handle, service, user);
 
 	if (ret < 0) {
 		return ret;
@@ -1280,6 +1376,15 @@ int vfs_gpfs_connect(struct vfs_handle_struct *handle, const char *service,
 	config->syncio = lp_parm_bool(SNUM(handle->conn), "gpfs",
 				      "syncio", false);
 
+	config->winattr = lp_parm_bool(SNUM(handle->conn), "gpfs",
+				       "winattr", false);
+
+	config->ftruncate = lp_parm_bool(SNUM(handle->conn), "gpfs",
+					 "ftruncate", true);
+
+	config->getrealfilename = lp_parm_bool(SNUM(handle->conn), "gpfs",
+					       "getrealfilename", true);
+
 	SMB_VFS_HANDLE_SET_DATA(handle, config,
 				NULL, struct gpfs_config_data,
 				return -1);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list