]> 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)
committerJon <jonathan.bailey1@ibm.com>
Fri, 3 Oct 2025 13:31:26 +0000 (14:31 +0100)
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>
(cherry picked from commit ca35c0de42861352bee4cfaeda6e83a7aa0bd094)

src/mds/Server.cc

index d0f799425d745ad385b1dc3b0a245748008a939a..33edba45ff96eff844046dca8614dc1e73ab1de6 100644 (file)
@@ -4778,16 +4778,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;