From: Patrick Donnelly Date: Mon, 4 Aug 2025 19:43:18 +0000 (-0400) Subject: mds: skip charmap handler check for MDS requests X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=601624d80162c0f75337cf48022c03a6b71eeb71;p=ceph.git 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) --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 931c1104f3f8..66993c915bc4 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -4704,16 +4704,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;