From 0c335a325d8ffcc71543d9e8503a47496dc6afb7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 12 Mar 2021 14:19:28 -0800 Subject: [PATCH] VFS: gluster: Allow vfs_gluster_fremovexattr() to cope with pathref fsps. Ensure it 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 --- source3/modules/vfs_glusterfs.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index cb83e012424..4fe71fcab9c 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -2080,8 +2080,19 @@ static int vfs_gluster_fremovexattr(struct vfs_handle_struct *handle, DBG_ERR("Failed to fetch gluster fd\n"); return -1; } - - return glfs_fremovexattr(glfd, name); + if (!fsp->fsp_flags.is_pathref) { + /* + * We can use an io_fd to remove xattrs. + */ + return glfs_fremovexattr(glfd, name); + } else { + /* + * This is no longer a handle based call. + */ + return glfs_removexattr(handle->data, + fsp->fsp_name->base_name, + name); + } } static int vfs_gluster_fsetxattr(struct vfs_handle_struct *handle, -- 2.47.3