1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

VFS: glusterfs: Ensure vfs_gluster_flistxattr() only uses an io fd for a handle based call.

Otherwise fall back to pathname based. This is the same as the
fallback used in vfs_default.c

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2021-03-11 23:03:19 -08:00
parent cb78268714
commit d89565ceeb

View File

@ -2049,8 +2049,20 @@ static ssize_t vfs_gluster_flistxattr(struct vfs_handle_struct *handle,
DBG_ERR("Failed to fetch gluster fd\n");
return -1;
}
return glfs_flistxattr(glfd, list, size);
if (!fsp->fsp_flags.is_pathref) {
/*
* We can use an io_fd to list xattrs.
*/
return glfs_flistxattr(glfd, list, size);
} else {
/*
* This is no longer a handle based call.
*/
return glfs_listxattr(handle->data,
fsp->fsp_name->base_name,
list,
size);
}
}
static int vfs_gluster_removexattr(struct vfs_handle_struct *handle,