]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_glusterfs: Add path based fallback mechanism for SMB_VFS_FNTIMES
authorAnoop C S <anoopcs@samba.org>
Thu, 13 Oct 2022 10:24:10 +0000 (15:54 +0530)
committerRalph Boehme <slow@samba.org>
Thu, 13 Oct 2022 12:30:37 +0000 (12:30 +0000)
Fallback mechanism was missing in vfs_gluster_fntimes() for path based
call. Therefore adding a similar mechanism as seen with other calls like
vfs_gluster_fsetxattr, vfs_gluster_fgetxattr etc.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15198

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_glusterfs.c

index 4b309de1377d02fb3d92b44528d9af4bffca8b23..31e606ba5d045124bdb32cb4e46da10622cc86db 100644 (file)
@@ -1772,7 +1772,13 @@ static int vfs_gluster_fntimes(struct vfs_handle_struct *handle,
                return -1;
        }
 
-       ret = glfs_futimens(glfd, times);
+       if (!fsp->fsp_flags.is_pathref) {
+               ret = glfs_futimens(glfd, times);
+       } else {
+               ret = glfs_utimens(handle->data,
+                                  fsp->fsp_name->base_name,
+                                  times);
+       }
        END_PROFILE(syscall_fntimes);
 
        return ret;