]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
VFS: gluster: Allow vfs_gluster_fremovexattr() to cope with pathref fsps.
authorJeremy Allison <jra@samba.org>
Fri, 12 Mar 2021 22:19:28 +0000 (14:19 -0800)
committerRalph Boehme <slow@samba.org>
Wed, 7 Apr 2021 16:26:28 +0000 (16:26 +0000)
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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_glusterfs.c

index cb83e0124244fc05dd3b58341d26b02368ecdf27..4fe71fcab9cff0e8765739dd3bc12bbf9dc0197d 100644 (file)
@@ -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,