]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
VFS: ceph: Allow cephwrap_fremovexattr() to cope with pathref fsps.
authorJeremy Allison <jra@samba.org>
Fri, 12 Mar 2021 22:16:05 +0000 (14:16 -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_ceph.c

index 038258a1d8da173c220fd05592c5e3a2ded36f45..6039127e13d2696358e424a1bf6baeb2161673f8 100644 (file)
@@ -1323,7 +1323,19 @@ static int cephwrap_fremovexattr(struct vfs_handle_struct *handle, struct files_
 {
        int ret;
        DBG_DEBUG("[CEPH] fremovexattr(%p, %p, %s)\n", handle, fsp, name);
-       ret = ceph_fremovexattr(handle->data, fsp_get_io_fd(fsp), name);
+       if (!fsp->fsp_flags.is_pathref) {
+               /*
+                * We can use an io_fd to remove xattrs.
+                */
+               ret = ceph_fremovexattr(handle->data, fsp_get_io_fd(fsp), name);
+       } else {
+               /*
+                * This is no longer a handle based call.
+                */
+               ret = ceph_removexattr(handle->data,
+                                       fsp->fsp_name->base_name,
+                                       name);
+       }
        DBG_DEBUG("[CEPH] fremovexattr(...) = %d\n", ret);
        WRAP_RETURN(ret);
 }