1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

VFS: ceph: Ensure cephwrap_fsetxattr() 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-11 23:00:14 -08:00
parent e4540a6b63
commit cb78268714

View File

@ -1332,8 +1332,27 @@ static int cephwrap_fsetxattr(struct vfs_handle_struct *handle, struct files_str
{
int ret;
DBG_DEBUG("[CEPH] fsetxattr(%p, %p, %s, %p, %llu, %d)\n", handle, fsp, name, value, llu(size), flags);
ret = ceph_fsetxattr(handle->data, fsp_get_io_fd(fsp),
name, value, size, flags);
if (!fsp->fsp_flags.is_pathref) {
/*
* We can use an io_fd to set xattrs.
*/
ret = ceph_fsetxattr(handle->data,
fsp_get_io_fd(fsp),
name,
value,
size,
flags);
} else {
/*
* This is no longer a handle based call.
*/
ret = ceph_setxattr(handle->data,
fsp->fsp_name->base_name,
name,
value,
size,
flags);
}
DBG_DEBUG("[CEPH] fsetxattr(...) = %d\n", ret);
WRAP_RETURN(ret);
}