From fd1b09bb3b2b54abb8830aa15539cd8d4b8237a1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 11 Mar 2021 23:06:37 -0800 Subject: [PATCH] VFS: glusterfs: Ensure vfs_gluster_fsetxattr() 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 Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Mar 12 20:38:03 UTC 2021 on sn-devel-184 --- source3/modules/vfs_glusterfs.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 86a5a88b14d..38c8a48c378 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -2094,7 +2094,22 @@ static int vfs_gluster_fsetxattr(struct vfs_handle_struct *handle, return -1; } - return glfs_fsetxattr(glfd, name, value, size, flags); + if (!fsp->fsp_flags.is_pathref) { + /* + * We can use an io_fd to set xattrs. + */ + return glfs_fsetxattr(glfd, name, value, size, flags); + } else { + /* + * This is no longer a handle based call. + */ + return glfs_setxattr(handle->data, + fsp->fsp_name->base_name, + name, + value, + size, + flags); + } } /* AIO Operations */ -- 2.47.3