From: Noel Power Date: Tue, 6 Apr 2021 16:08:50 +0000 (+0100) Subject: VFS: gluster: Allow vfs_gluster_fchmod() to cope with pathref fsps. X-Git-Tag: tevent-0.11.0~1226 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fcf696bfa2827bb5b726c4f1d8cc24ba9c41f613;p=thirdparty%2Fsamba.git VFS: gluster: Allow vfs_gluster_fchmod() to cope with pathref fsps. Ensure it only uses an io fd for a handle based call. Signed-off-by: Noel Power Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 5a36b94c41b..ef52f83f9bc 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -1486,7 +1486,17 @@ static int vfs_gluster_fchmod(struct vfs_handle_struct *handle, return -1; } - ret = glfs_fchmod(glfd, mode); + if (!fsp->fsp_flags.is_pathref) { + /* + * We can use an io_fd to remove xattrs. + */ + ret = glfs_fchmod(glfd, mode); + } else { + /* + * This is no longer a handle based call. + */ + ret = glfs_chmod(handle->data, fsp->fsp_name->base_name, mode); + } END_PROFILE(syscall_fchmod); return ret;