From d667e48869c72275824a59cf81676bbb4066f26c Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 4 Aug 2025 15:43:18 -0400 Subject: [PATCH] mds: skip charmap handler check for MDS requests The MDS uses a rename request to move the primary link to a remote link. For these requests, there will be no session. Fixes: https://tracker.ceph.com/issues/72349 Signed-off-by: Patrick Donnelly (cherry picked from commit ca35c0de42861352bee4cfaeda6e83a7aa0bd094) --- src/mds/Server.cc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 6dd9b330972..081a57faf3f 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -4772,16 +4772,18 @@ bool Server::is_valid_layout(file_layout_t *layout) bool Server::can_handle_charmap(const MDRequestRef& mdr, CDentry* dn) { - CDir *dir = dn->get_dir(); - CInode *diri = dir->get_inode(); - if (auto* csp = diri->get_charmap()) { - dout(20) << __func__ << ": with " << *csp << dendl; - auto& client_metadata = mdr->session->info.client_metadata; - bool allowed = client_metadata.features.test(CEPHFS_FEATURE_CHARMAP); - if (!allowed) { - dout(5) << " client cannot handle charmap" << dendl; - respond_to_request(mdr, -EPERM); - return false; + if (mdr->session) { + CDir *dir = dn->get_dir(); + CInode *diri = dir->get_inode(); + if (auto* csp = diri->get_charmap()) { + dout(20) << __func__ << ": with " << *csp << dendl; + auto& client_metadata = mdr->session->info.client_metadata; + bool allowed = client_metadata.features.test(CEPHFS_FEATURE_CHARMAP); + if (!allowed) { + dout(5) << " client cannot handle charmap" << dendl; + respond_to_request(mdr, -EPERM); + return false; + } } } return true; -- 2.39.5