VFS: glusterfs: Ensure vfs_gluster_fsetxattr() only uses an io fd for a handle based...
authorJeremy Allison <jra@samba.org>
Fri, 12 Mar 2021 07:06:37 +0000 (23:06 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 12 Mar 2021 20:38:03 +0000 (20:38 +0000)
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>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 12 20:38:03 UTC 2021 on sn-devel-184

source3/modules/vfs_glusterfs.c

index 86a5a88b14dfb2f744b142112d3b20965020ceac..38c8a48c378712e70aa708a4b54dbb9490cd9bc3 100644 (file)
@@ -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 */