The branch, v4-22-stable has been updated
       via  fc3005dbad5 VERSION: Disable GIT_SNAPSHOT for the Samba 4.22.0rc1 
release.
       via  5539768a3ac WHATSNEW: Up to Samba 4.22.0rc1.
       via  8d398acbbb7 tevent: version 0.16.2
       via  77229f73c20 talloc: version 2.4.3
       via  70a8c7a89a6 tdb: version 1.4.13
       via  8f27da18b57 vfs_gpfs: Remove one whitespace
       via  edfd45a8f8a gpfswrap: Remove unused gpfs_set_winattrs_path
       via  35538c408ce gpfswrap: Remove unused gpfs_fstat_x
       via  dd4c331bd2e gpfswrap: Remove unused gpfs_stat_x wrapper
       via  2f114d0d110 vfs_gpfs: Remove winattr calls from vfs_gpfs_fntimes
       via  fb8138275f9 vfs_gpfs: Set creation time from 
vfs_gpfs_fset_dos_attributes
       via  d3543e0b77f vfs_gpfs: Simplify vfs_gpfs_fset_dos_attributes
       via  dd7cc4da0f3 vfs_gpfs: Use gpfs_get_winattrs instead of gpfs_fstat_x
       via  4787c737ec0 vfs_gpfs: Remove pathref test
       via  d86986da399 vfs_gpfs: Remove gpfs_stat_x fallback
       via  30b7181d0a4 librpc/ndr: apply some const to ndr_push_union_blob()
      from  0a48167044b vfs_gpfs: add gpfs:clamp_invalid_times

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


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

Summary of changes:
 VERSION                                            |   6 +-
 WHATSNEW.txt                                       |   2 +-
 ...oc-util-2.3.0.sigs => pytalloc-util-2.4.3.sigs} |   0
 .../ABI/{talloc-2.3.5.sigs => talloc-2.4.3.sigs}   |   0
 lib/talloc/wscript                                 |   2 +-
 lib/tdb/ABI/{tdb-1.3.17.sigs => tdb-1.4.13.sigs}   |   0
 lib/tdb/wscript                                    |   2 +-
 .../ABI/{tevent-0.15.0.sigs => tevent-0.16.2.sigs} |   0
 lib/tevent/wscript                                 |   2 +-
 lib/util/gpfswrap.c                                |  44 ----
 lib/util/gpfswrap.h                                |   7 -
 librpc/ABI/ndr-6.0.0.sigs                          |   2 +-
 librpc/ndr/libndr.h                                |   2 +-
 librpc/ndr/ndr.c                                   |   2 +-
 source3/modules/vfs_gpfs.c                         | 260 ++++-----------------
 15 files changed, 58 insertions(+), 273 deletions(-)
 copy lib/talloc/ABI/{pytalloc-util-2.3.0.sigs => pytalloc-util-2.4.3.sigs} 
(100%)
 copy lib/talloc/ABI/{talloc-2.3.5.sigs => talloc-2.4.3.sigs} (100%)
 copy lib/tdb/ABI/{tdb-1.3.17.sigs => tdb-1.4.13.sigs} (100%)
 copy lib/tevent/ABI/{tevent-0.15.0.sigs => tevent-0.16.2.sigs} (100%)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index a09bd14320e..1954746576f 100644
--- a/VERSION
+++ b/VERSION
@@ -79,7 +79,7 @@ SAMBA_VERSION_BETA_RELEASE=
 # e.g. SAMBA_VERSION_PRE_RELEASE=1                     #
 #  ->  "2.2.9pre1"                                     #
 ########################################################
-SAMBA_VERSION_PRE_RELEASE=1
+SAMBA_VERSION_PRE_RELEASE=
 
 ########################################################
 # For 'rc' releases the version will be                #
@@ -89,7 +89,7 @@ SAMBA_VERSION_PRE_RELEASE=1
 # e.g. SAMBA_VERSION_RC_RELEASE=1                      #
 #  ->  "3.0.0rc1"                                      #
 ########################################################
-SAMBA_VERSION_RC_RELEASE=
+SAMBA_VERSION_RC_RELEASE=1
 
 ########################################################
 # To mark SVN snapshots this should be set to 'yes'    #
@@ -101,7 +101,7 @@ SAMBA_VERSION_RC_RELEASE=
 # e.g. SAMBA_VERSION_IS_SVN_SNAPSHOT=yes               #
 #  ->  "3.0.0-SVN-build-199"                           #
 ########################################################
-SAMBA_VERSION_IS_GIT_SNAPSHOT=yes
+SAMBA_VERSION_IS_GIT_SNAPSHOT=no
 
 ########################################################
 # This is for specifying a release nickname            #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 9a056da4810..76aecf200cd 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,7 +1,7 @@
 Release Announcements
 =====================
 
-This is the first pre release of Samba 4.22.  This is *not*
+This is the first release candidate of Samba 4.22.  This is *not*
 intended for production environments and is designed for testing
 purposes only.  Please report any defects via the Samba bug reporting
 system at https://bugzilla.samba.org/.
diff --git a/lib/talloc/ABI/pytalloc-util-2.3.0.sigs 
b/lib/talloc/ABI/pytalloc-util-2.4.3.sigs
similarity index 100%
copy from lib/talloc/ABI/pytalloc-util-2.3.0.sigs
copy to lib/talloc/ABI/pytalloc-util-2.4.3.sigs
diff --git a/lib/talloc/ABI/talloc-2.3.5.sigs b/lib/talloc/ABI/talloc-2.4.3.sigs
similarity index 100%
copy from lib/talloc/ABI/talloc-2.3.5.sigs
copy to lib/talloc/ABI/talloc-2.4.3.sigs
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 1b240ae3653..b4b89ec1993 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'talloc'
-VERSION = '2.4.2'
+VERSION = '2.4.3'
 
 import os
 import sys
diff --git a/lib/tdb/ABI/tdb-1.3.17.sigs b/lib/tdb/ABI/tdb-1.4.13.sigs
similarity index 100%
copy from lib/tdb/ABI/tdb-1.3.17.sigs
copy to lib/tdb/ABI/tdb-1.4.13.sigs
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index 812e5987daf..d647cb5da9a 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'tdb'
-VERSION = '1.4.12'
+VERSION = '1.4.13'
 
 import sys, os
 
diff --git a/lib/tevent/ABI/tevent-0.15.0.sigs 
b/lib/tevent/ABI/tevent-0.16.2.sigs
similarity index 100%
copy from lib/tevent/ABI/tevent-0.15.0.sigs
copy to lib/tevent/ABI/tevent-0.16.2.sigs
diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 8df1b40febf..317a0c5e0b5 100644
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'tevent'
-VERSION = '0.16.1'
+VERSION = '0.16.2'
 
 import sys, os
 
diff --git a/lib/util/gpfswrap.c b/lib/util/gpfswrap.c
index 2f15bf452cf..8012e29163c 100644
--- a/lib/util/gpfswrap.c
+++ b/lib/util/gpfswrap.c
@@ -29,9 +29,6 @@ static int (*gpfs_get_realfilename_path_fn)(const char 
*pathname,
                                            char *filenamep,
                                            int *len);
 static int (*gpfs_register_cifs_export_fn)(void);
-static int (*gpfs_set_winattrs_path_fn)(const char *pathname,
-                                       int flags,
-                                       struct gpfs_winattr *attrs);
 static int (*gpfs_set_winattrs_fn)(int fd, int flags,
                                   struct gpfs_winattr *attrs);
 static int (*gpfs_get_winattrs_fn)(int fd, struct gpfs_winattr *attrs);
@@ -49,10 +46,6 @@ static int (*gpfs_init_trace_fn)(void);
 static int (*gpfs_query_trace_fn)(void);
 static void (*gpfs_add_trace_fn)(int level, const char *msg);
 static void (*gpfs_fini_trace_fn)(void);
-static int (*gpfs_fstat_x_fn)(int fd, unsigned int *litemask,
-                             struct gpfs_iattr64 *iattr, size_t len);
-static int (*gpfs_stat_x_fn)(const char *pathname, unsigned int *litemask,
-                            struct gpfs_iattr64 *iattr, size_t len);
 
 int gpfswrap_init(void)
 {
@@ -73,7 +66,6 @@ int gpfswrap_init(void)
        gpfs_putacl_fn                = dlsym(l, "gpfs_putacl");
        gpfs_get_realfilename_path_fn = dlsym(l, "gpfs_get_realfilename_path");
        gpfs_register_cifs_export_fn  = dlsym(l, "gpfs_register_cifs_export");
-       gpfs_set_winattrs_path_fn     = dlsym(l, "gpfs_set_winattrs_path");
        gpfs_set_winattrs_fn          = dlsym(l, "gpfs_set_winattrs");
        gpfs_get_winattrs_fn          = dlsym(l, "gpfs_get_winattrs");
        gpfs_ftruncate_fn             = dlsym(l, "gpfs_ftruncate");
@@ -85,8 +77,6 @@ int gpfswrap_init(void)
        gpfs_query_trace_fn           = dlsym(l, "gpfs_query_trace");
        gpfs_add_trace_fn             = dlsym(l, "gpfs_add_trace");
        gpfs_fini_trace_fn            = dlsym(l, "gpfs_fini_trace");
-       gpfs_fstat_x_fn       = dlsym(l, "gpfs_fstat_x");
-       gpfs_stat_x_fn                = dlsym(l, "gpfs_stat_x");
 
        return 0;
 }
@@ -153,18 +143,6 @@ int gpfswrap_register_cifs_export(void)
        return gpfs_register_cifs_export_fn();
 }
 
-int gpfswrap_set_winattrs_path(const char *pathname,
-                              int flags,
-                              struct gpfs_winattr *attrs)
-{
-       if (gpfs_set_winattrs_path_fn == NULL) {
-               errno = ENOSYS;
-               return -1;
-       }
-
-       return gpfs_set_winattrs_path_fn(pathname, flags, attrs);
-}
-
 int gpfswrap_set_winattrs(int fd, int flags, struct gpfs_winattr *attrs)
 {
        if (gpfs_set_winattrs_fn == NULL) {
@@ -272,25 +250,3 @@ void gpfswrap_fini_trace(void)
 
        gpfs_fini_trace_fn();
 }
-
-int gpfswrap_fstat_x(int fd, unsigned int *litemask,
-                    struct gpfs_iattr64 *iattr, size_t len)
-{
-       if (gpfs_fstat_x_fn == NULL) {
-               errno = ENOSYS;
-               return -1;
-       }
-
-       return gpfs_fstat_x_fn(fd, litemask, iattr, len);
-}
-
-int gpfswrap_stat_x(const char *pathname, unsigned int *litemask,
-                   struct gpfs_iattr64 *iattr, size_t len)
-{
-       if (gpfs_stat_x_fn == NULL) {
-               errno = ENOSYS;
-               return -1;
-       }
-
-       return gpfs_stat_x_fn(pathname, litemask, iattr, len);
-}
diff --git a/lib/util/gpfswrap.h b/lib/util/gpfswrap.h
index e387a56446b..c1d87b098c5 100644
--- a/lib/util/gpfswrap.h
+++ b/lib/util/gpfswrap.h
@@ -35,9 +35,6 @@ int gpfswrap_get_realfilename_path(const char *pathname,
                                   char *filenamep,
                                   int *len);
 int gpfswrap_register_cifs_export(void);
-int gpfswrap_set_winattrs_path(const char *pathname,
-                              int flags,
-                              struct gpfs_winattr *attrs);
 int gpfswrap_set_winattrs(int fd, int flags, struct gpfs_winattr *attrs);
 int gpfswrap_get_winattrs(int fd, struct gpfs_winattr *attrs);
 int gpfswrap_ftruncate(int fd, gpfs_off64_t length);
@@ -49,9 +46,5 @@ int gpfswrap_init_trace(void);
 int gpfswrap_query_trace(void);
 void gpfswrap_add_trace(int level, const char *msg);
 void gpfswrap_fini_trace(void);
-int gpfswrap_fstat_x(int fd, unsigned int *litemask,
-                    struct gpfs_iattr64 *iattr, size_t len);
-int gpfswrap_stat_x(const char *pathname, unsigned int *litemask,
-                   struct gpfs_iattr64 *iattr, size_t len);
 
 #endif
diff --git a/librpc/ABI/ndr-6.0.0.sigs b/librpc/ABI/ndr-6.0.0.sigs
index e68248f2016..0969af5db06 100644
--- a/librpc/ABI/ndr-6.0.0.sigs
+++ b/librpc/ABI/ndr-6.0.0.sigs
@@ -245,7 +245,7 @@ ndr_push_uint32: enum ndr_err_code (struct ndr_push *, 
ndr_flags_type, uint32_t)
 ndr_push_uint3264: enum ndr_err_code (struct ndr_push *, ndr_flags_type, 
uint32_t)
 ndr_push_uint8: enum ndr_err_code (struct ndr_push *, ndr_flags_type, uint8_t)
 ndr_push_union_align: enum ndr_err_code (struct ndr_push *, size_t)
-ndr_push_union_blob: enum ndr_err_code (DATA_BLOB *, TALLOC_CTX *, void *, 
uint32_t, ndr_push_flags_fn_t)
+ndr_push_union_blob: enum ndr_err_code (DATA_BLOB *, TALLOC_CTX *, const void 
*, uint32_t, ndr_push_flags_fn_t)
 ndr_push_unique_ptr: enum ndr_err_code (struct ndr_push *, const void *)
 ndr_push_winreg_Data: enum ndr_err_code (struct ndr_push *, ndr_flags_type, 
const union winreg_Data *)
 ndr_push_winreg_Data_GPO: enum ndr_err_code (struct ndr_push *, 
ndr_flags_type, const union winreg_Data_GPO *)
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index 9f1d7ac9107..344f08b20a1 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -632,7 +632,7 @@ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, 
TALLOC_CTX *mem_ctx, con
 enum ndr_err_code ndr_push_struct_into_fixed_blob(DATA_BLOB *blob,
                                                  const void *p,
                                                  ndr_push_flags_fn_t fn);
-enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, 
void *p, uint32_t level, ndr_push_flags_fn_t fn);
+enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, 
const void *p, uint32_t level, ndr_push_flags_fn_t fn);
 size_t ndr_size_struct(const void *p, libndr_flags flags, ndr_push_flags_fn_t 
push);
 size_t ndr_size_union(const void *p, libndr_flags flags, uint32_t level, 
ndr_push_flags_fn_t push);
 uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr);
diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c
index c25e8bd1ca5..896f682d2c2 100644
--- a/librpc/ndr/ndr.c
+++ b/librpc/ndr/ndr.c
@@ -1668,7 +1668,7 @@ _PUBLIC_ enum ndr_err_code 
ndr_push_struct_into_fixed_blob(
 /*
   push a union to a blob using NDR
 */
-_PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX 
*mem_ctx, void *p,
+_PUBLIC_ enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX 
*mem_ctx, const void *p,
                             uint32_t level, ndr_push_flags_fn_t fn)
 {
        struct ndr_push *ndr;
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index fb3e8c806e1..48f3bbad363 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -56,9 +56,6 @@ struct gpfs_config_data {
        bool settimes;
        bool recalls;
        bool clamp_invalid_times;
-       struct {
-               bool gpfs_fstat_x;
-       } pathref_ok;
 };
 
 struct gpfs_fsp_extension {
@@ -527,7 +524,7 @@ again:
 }
 
 /* Tries to get nfs4 acls and returns SMB ACL allocated.
- * On failure returns 1 if it got non-NFSv4 ACL to prompt 
+ * On failure returns 1 if it got non-NFSv4 ACL to prompt
  * retry with POSIX ACL checks.
  * On failure returns -1 if there is system (GPFS) error, check errno.
  * Returns 0 on success
@@ -1436,21 +1433,12 @@ static unsigned int 
vfs_gpfs_dosmode_to_winattrs(uint32_t dosmode)
        return winattrs;
 }
 
-static struct timespec gpfs_timestruc64_to_timespec(struct gpfs_timestruc64 g)
-{
-       return (struct timespec) { .tv_sec = g.tv_sec, .tv_nsec = g.tv_nsec };
-}
-
 static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle,
                                             struct files_struct *fsp,
                                             uint32_t *dosmode)
 {
        struct gpfs_config_data *config;
-       int fd = fsp_get_pathref_fd(fsp);
-       struct sys_proc_fd_path_buf buf;
-       const char *p = NULL;
-       struct gpfs_iattr64 iattr = { };
-       unsigned int litemask = 0;
+       struct gpfs_winattr attrs = { };
        struct timespec ts;
        int ret;
 
@@ -1462,19 +1450,7 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct 
vfs_handle_struct *handle,
                return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode);
        }
 
-       if (fsp->fsp_flags.is_pathref && !config->pathref_ok.gpfs_fstat_x) {
-               if (fsp->fsp_flags.have_proc_fds) {
-                       p = sys_proc_fd_path(fd, &buf);
-               } else {
-                       p = fsp->fsp_name->base_name;
-               }
-       }
-
-       if (p != NULL) {
-               ret = gpfswrap_stat_x(p, &litemask, &iattr, sizeof(iattr));
-       } else {
-               ret = gpfswrap_fstat_x(fd, &litemask, &iattr, sizeof(iattr));
-       }
+       ret = gpfswrap_get_winattrs(fsp_get_pathref_fd(fsp), &attrs);
        if (ret == -1 && errno == ENOSYS) {
                return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode);
        }
@@ -1491,17 +1467,7 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct 
vfs_handle_struct *handle,
 
                set_effective_capability(DAC_OVERRIDE_CAPABILITY);
 
-               if (p != NULL) {
-                       ret = gpfswrap_stat_x(p,
-                                             &litemask,
-                                             &iattr,
-                                             sizeof(iattr));
-               } else {
-                       ret = gpfswrap_fstat_x(fd,
-                                              &litemask,
-                                              &iattr,
-                                              sizeof(iattr));
-               }
+               ret = gpfswrap_get_winattrs(fsp_get_pathref_fd(fsp), &attrs);
                if (ret == -1) {
                        saved_errno = errno;
                }
@@ -1519,14 +1485,40 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct 
vfs_handle_struct *handle,
                return map_nt_error_from_unix(errno);
        }
 
-       ts = gpfs_timestruc64_to_timespec(iattr.ia_createtime);
+       ts.tv_sec = attrs.creationTime.tv_sec;
+       ts.tv_nsec = attrs.creationTime.tv_nsec;
 
-       *dosmode |= vfs_gpfs_winattrs_to_dosmode(iattr.ia_winflags);
+       *dosmode |= vfs_gpfs_winattrs_to_dosmode(attrs.winAttrs);
        update_stat_ex_create_time(&fsp->fsp_name->st, ts);
 
        return NT_STATUS_OK;
 }
 
+static int timespec_to_gpfs_timestruc(struct gpfs_config_data *config,
+                                     struct timespec ts,
+                                     struct gpfs_timestruc *gt)
+{
+       if (ts.tv_sec < 0 || ts.tv_sec > UINT32_MAX) {
+               if (!config->clamp_invalid_times) {
+                       DBG_NOTICE("GPFS uses 32-bit unsigned timestamps "
+                                  "and cannot handle %jd.\n",
+                                  (intmax_t)ts.tv_sec);
+                       errno = ERANGE;
+                       return -1;
+               }
+               if (ts.tv_sec < 0) {
+                       ts.tv_sec = 0;
+               } else {
+                       ts.tv_sec = UINT32_MAX;
+               }
+       }
+
+       gt->tv_sec = ts.tv_sec;
+       gt->tv_nsec = ts.tv_nsec;
+
+       return 0;
+}
+
 static NTSTATUS vfs_gpfs_fset_dos_attributes(struct vfs_handle_struct *handle,
                                             struct files_struct *fsp,
                                             uint32_t dosmode)
@@ -1543,43 +1535,19 @@ static NTSTATUS vfs_gpfs_fset_dos_attributes(struct 
vfs_handle_struct *handle,
                return SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, dosmode);
        }
 
-       attrs.winAttrs = vfs_gpfs_dosmode_to_winattrs(dosmode);
-
-       if (!fsp->fsp_flags.is_pathref) {
-               ret = gpfswrap_set_winattrs(fsp_get_io_fd(fsp),
-                                           GPFS_WINATTR_SET_ATTRS, &attrs);
-               if (ret == -1) {
-                       DBG_WARNING("Setting winattrs failed for %s: %s\n",
-                                   fsp_str_dbg(fsp), strerror(errno));
-                       return map_nt_error_from_unix(errno);
-               }
-               return NT_STATUS_OK;
+       ret = timespec_to_gpfs_timestruc(config,
+                                        fsp->fsp_name->st.st_ex_btime,
+                                        &attrs.creationTime);
+       if (ret == -1) {
+               return map_nt_error_from_unix(errno);
        }
 
-       if (fsp->fsp_flags.have_proc_fds) {
-               int fd = fsp_get_pathref_fd(fsp);
-               struct sys_proc_fd_path_buf buf;
-
-               ret = gpfswrap_set_winattrs_path(sys_proc_fd_path(fd, &buf),
-                                                GPFS_WINATTR_SET_ATTRS,
-                                                &attrs);
-               if (ret == -1) {
-                       DBG_WARNING("Setting winattrs failed for "
-                                   "[%s][%s]: %s\n",
-                                   buf.buf,
-                                   fsp_str_dbg(fsp),
-                                   strerror(errno));
-                       return map_nt_error_from_unix(errno);
-               }
-               return NT_STATUS_OK;
-       }
+       attrs.winAttrs = vfs_gpfs_dosmode_to_winattrs(dosmode);
 
-       /*
-        * This is no longer a handle based call.
-        */
-       ret = gpfswrap_set_winattrs_path(fsp->fsp_name->base_name,
-                                        GPFS_WINATTR_SET_ATTRS,
-                                        &attrs);
+       ret = gpfswrap_set_winattrs(fsp_get_pathref_fd(fsp),
+                                   GPFS_WINATTR_SET_CREATION_TIME|
+                                   GPFS_WINATTR_SET_ATTRS,
+                                   &attrs);
        if (ret == -1) {
                DBG_WARNING("Setting winattrs failed for [%s]: %s\n",
                            fsp_str_dbg(fsp), strerror(errno));
@@ -1595,28 +1563,18 @@ static int timespec_to_gpfs_time(struct 
gpfs_config_data *config,
                                 int idx,
                                 int *flags)
 {
+       int ret;
+
        if (is_omit_timespec(&ts)) {
                return 0;
        }
 
-       if (ts.tv_sec < 0 || ts.tv_sec > UINT32_MAX) {
-               if (!config->clamp_invalid_times) {
-                       DBG_NOTICE("GPFS uses 32-bit unsigned timestamps "
-                                  "and cannot handle %jd.\n",
-                                  (intmax_t)ts.tv_sec);
-                       errno = ERANGE;
-                       return -1;
-               }
-               if (ts.tv_sec < 0) {
-                       ts.tv_sec = 0;
-               } else {
-                       ts.tv_sec = UINT32_MAX;
-               }
+       ret = timespec_to_gpfs_timestruc(config, ts, &gt[idx]);
+       if (ret == -1) {
+               return ret;
        }
 
        *flags |= 1 << idx;
-       gt[idx].tv_sec = ts.tv_sec;
-       gt[idx].tv_nsec = ts.tv_nsec;
        DBG_DEBUG("Setting GPFS time %d, flags 0x%x\n", idx, *flags);
 
        return 0;
@@ -1701,7 +1659,6 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct 
*handle,
                struct smb_file_time *ft)
 {
 
-       struct gpfs_winattr attrs;
        int ret;
        struct gpfs_config_data *config;
 
@@ -1715,8 +1672,7 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct 
*handle,
                return smbd_gpfs_set_times(config, fsp, ft);
        }
 
-       DBG_DEBUG("gpfs_set_times() not available or disabled, "
-                 "use ntimes and winattr\n");
+       DBG_DEBUG("gpfs_set_times() not available or disabled.\n");
 
        ret = SMB_VFS_NEXT_FNTIMES(handle, fsp, ft);
        if (ret == -1) {
@@ -1728,56 +1684,6 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct 
*handle,
                return -1;
        }
 
-       if (is_omit_timespec(&ft->create_time)) {
-               DBG_DEBUG("Create Time is NULL\n");
-               return 0;
-       }
-
-       if (!config->winattr) {
-               return 0;
-       }
-
-       attrs.winAttrs = 0;
-       attrs.creationTime.tv_sec = ft->create_time.tv_sec;
-       attrs.creationTime.tv_nsec = ft->create_time.tv_nsec;


-- 
Samba Shared Repository

Reply via email to