From: Jeremy Allison Date: Fri, 12 Mar 2021 07:06:37 +0000 (-0800) Subject: VFS: glusterfs: Ensure vfs_gluster_fsetxattr() only uses an io fd for a handle based... X-Git-Tag: tevent-0.11.0~1553 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd1b09bb3b2b54abb8830aa15539cd8d4b8237a1;p=thirdparty%2Fsamba.git 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 --- 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 */