From: Christof Schmitt Date: Tue, 4 Feb 2025 21:05:58 +0000 (-0700) Subject: vfs_gpfs: Remove winattr calls from vfs_gpfs_fntimes X-Git-Tag: tdb-1.4.13~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f114d0d1100099d4ea13aeddf99cd1f4735007e;p=thirdparty%2Fsamba.git vfs_gpfs: Remove winattr calls from vfs_gpfs_fntimes The call to the default function for fntimes already calls back into fset_dos_attributes to set the create time. It is not necessary to repeat the code in vfs_gpfs_fntimes. Signed-off-by: Christof Schmitt Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index b3c21295c51..12d340ede52 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -1659,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; @@ -1673,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) { @@ -1686,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; - - if (!fsp->fsp_flags.is_pathref) { - ret = gpfswrap_set_winattrs(fsp_get_io_fd(fsp), - GPFS_WINATTR_SET_CREATION_TIME, - &attrs); - if (ret == -1 && errno != ENOSYS) { - DBG_WARNING("Set GPFS ntimes failed %d\n", ret); - return -1; - } - return ret; - } - - 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_CREATION_TIME, - &attrs); - if (ret == -1 && errno != ENOSYS) { - DBG_WARNING("Set GPFS ntimes failed %d\n", ret); - return -1; - } - return ret; - } - - /* - * This is no longer a handle based call. - */ - ret = gpfswrap_set_winattrs_path(fsp->fsp_name->base_name, - GPFS_WINATTR_SET_CREATION_TIME, - &attrs); - if (ret == -1 && errno != ENOSYS) { - DBG_WARNING("Set GPFS ntimes failed %d\n", ret); - return -1; - } - return 0; }