From 4fe4f2dc55f7e581e4f2ed6d57019f07d158cf99 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 22 Aug 2024 14:36:46 -0400 Subject: [PATCH] mds: move fscrypt_file inode_t metadata to mds_co mempool Fixes: https://tracker.ceph.com/issues/67687 Signed-off-by: Patrick Donnelly (cherry picked from commit bf8f704e2311f331b45764783211431622046a2b) --- src/include/cephfs/types.h | 2 +- src/mds/CInode.cc | 2 +- src/mds/Locker.cc | 2 +- src/mds/Server.cc | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/cephfs/types.h b/src/include/cephfs/types.h index 2d57094f458..d3da63076a0 100644 --- a/src/include/cephfs/types.h +++ b/src/include/cephfs/types.h @@ -607,7 +607,7 @@ struct inode_t { std::basic_string,Allocator> stray_prior_path; //stores path before unlink std::vector> fscrypt_auth; - std::vector fscrypt_file; + std::vector> fscrypt_file; bufferlist fscrypt_last_block; diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index a53d693ddf2..986470475cd 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -4223,7 +4223,7 @@ void CInode::encode_cap_message(const ref_t &m, Capability *cap) m->size = i->size; m->truncate_seq = i->truncate_seq; m->truncate_size = i->truncate_size; - m->fscrypt_file = i->fscrypt_file; + m->fscrypt_file.assign(i->fscrypt_file.begin(), i->fscrypt_file.end()); m->fscrypt_auth.assign(i->fscrypt_auth.begin(), i->fscrypt_auth.end()); m->mtime = i->mtime; m->atime = i->atime; diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index b976f1b32e9..469a37f8033 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3977,7 +3977,7 @@ void Locker::_update_cap_fields(CInode *in, int dirty, const cref_t pi->time_warp_seq = m->get_time_warp_seq(); } if (m->fscrypt_file.size()) - pi->fscrypt_file = m->fscrypt_file; + pi->fscrypt_file.assign(m->fscrypt_file.begin(), m->fscrypt_file.end()); } // auth if (dirty & CEPH_CAP_AUTH_EXCL) { diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 5a5a6f32a04..895c915e7d6 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -3572,7 +3572,7 @@ CInode* Server::prepare_new_inode(const MDRequestRef& mdr, CDir *dir, inodeno_t dout(10) << "copying fscrypt_auth len " << req->fscrypt_auth.size() << dendl; _inode->fscrypt_auth.assign(req->fscrypt_auth.begin(), req->fscrypt_auth.end()); - _inode->fscrypt_file = req->fscrypt_file; + _inode->fscrypt_file.assign(req->fscrypt_file.begin(), req->fscrypt_file.end()); if (req->get_data().length()) { auto p = req->get_data().cbegin(); @@ -5474,7 +5474,7 @@ void Server::handle_client_setattr(const MDRequestRef& mdr) if (mask & CEPH_SETATTR_FSCRYPT_AUTH) pi.inode->fscrypt_auth.assign(req->fscrypt_auth.begin(), req->fscrypt_auth.end()); if (mask & CEPH_SETATTR_FSCRYPT_FILE) - pi.inode->fscrypt_file = req->fscrypt_file; + pi.inode->fscrypt_file.assign(req->fscrypt_file.begin(), req->fscrypt_file.end()); pi.inode->version = cur->pre_dirty(); pi.inode->ctime = mdr->get_op_stamp(); -- 2.39.5