1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

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 <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2021-03-12 14:16:05 -08:00 committed by Ralph Boehme
parent a2fd9df127
commit ea1b763b6a

View 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);
}