From: Jeremy Allison Date: Fri, 12 Mar 2021 22:16:05 +0000 (-0800) Subject: VFS: ceph: Allow cephwrap_fremovexattr() to cope with pathref fsps. X-Git-Tag: tevent-0.11.0~1285 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea1b763b6a6785f6dacd0d264948f32ab1ba6f92;p=thirdparty%2Fsamba.git VFS: ceph: Allow cephwrap_fremovexattr() to cope with pathref fsps. 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 038258a1d8d..6039127e13d 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -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); }