]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: skip charmap handler check for MDS requests
authorPatrick Donnelly <pdonnell@ibm.com>
Mon, 4 Aug 2025 19:43:18 +0000 (15:43 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Tue, 5 Aug 2025 01:48:49 +0000 (21:48 -0400)
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 <pdonnell@ibm.com>
src/mds/Server.cc

index 97657dbc94b480a9eb64fcf8777890b762bae939..fca68e5c5da39f7f3dfd054e1d883bdd017b9280 100644 (file)
@@ -4808,16 +4808,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;