vfs_glusterfs: allow path based ops without glfd in vfs_gluster_fremovexattr()
authorRalph Boehme <slow@samba.org>
Fri, 8 Dec 2023 17:57:22 +0000 (18:57 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 8 Dec 2023 17:57:59 +0000 (18:57 +0100)
source3/modules/vfs_glusterfs.c

index 2a0b4c27d1ae1951a1a9b7e401ea3fd9a817e3ad..3a9f543017e335b540be8a55590521fbf37bd82a 100644 (file)
@@ -2400,15 +2400,16 @@ static ssize_t vfs_gluster_flistxattr(struct vfs_handle_struct *handle,
 static int vfs_gluster_fremovexattr(struct vfs_handle_struct *handle,
                                    files_struct *fsp, const char *name)
 {
-       glfs_fd_t *glfd = vfs_gluster_fetch_glfd(handle, fsp);
-       if (glfd == NULL) {
-               DBG_ERR("Failed to fetch gluster fd\n");
-               return -1;
-       }
        if (!fsp->fsp_flags.is_pathref) {
                /*
                 * We can use an io_fd to remove xattrs.
                 */
+               glfs_fd_t *glfd = vfs_gluster_fetch_glfd(handle, fsp);
+
+               if (glfd == NULL) {
+                       DBG_ERR("Failed to fetch gluster fd\n");
+                       return -1;
+               }
                return glfs_fremovexattr(glfd, name);
        } else {
                /*