From 60d2b304eca870992aed0cd3e4741d5bc7664901 Mon Sep 17 00:00:00 2001 From: Christopher Hoffman Date: Mon, 21 Apr 2025 12:28:16 +0000 Subject: [PATCH] client: Rework vxattr_cb_fscrypt_file_set to assign properly Signed-off-by: Christopher Hoffman --- src/client/Client.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 2a864a6092d..b1daaeb5d96 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -15174,8 +15174,12 @@ int Client::_vxattrcb_fscrypt_file_set(Inode *in, const void *val, size_t size, std::vector aux; aux.resize(sizeof(uint64_t)); - memcpy(aux.data(), val, size); + uint64_t the_size; + + memcpy(&the_size, val, size); + *(ceph_le64 *)aux.data() = the_size; + // TODO: rework _do_setattr to pass mask CEPH_SETATTR_FSCRYPT_FILE return _do_setattr(in, &stx, CEPH_SETATTR_SIZE, perms, nullptr, &aux); } -- 2.39.5