From: Jeremy Allison Date: Fri, 12 Mar 2021 07:03:19 +0000 (-0800) Subject: VFS: glusterfs: Ensure vfs_gluster_flistxattr() only uses an io fd for a handle based... X-Git-Tag: tevent-0.11.0~1554 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d89565ceeb5b7df2d230382a636ff3983898aeec;p=thirdparty%2Fsamba.git 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index c3fe1c60f7f..86a5a88b14d 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -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,