]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: inherit charmap on mkdir
authorPatrick Donnelly <pdonnell@ibm.com>
Wed, 23 Oct 2024 18:01:41 +0000 (14:01 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 17 Mar 2025 19:43:18 +0000 (15:43 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Fixes: https://tracker.ceph.com/issues/66373
(cherry picked from commit 033d8666373f239b18d52f3fd8c350148ba4f4a1)

src/mds/Server.cc

index e9f73c56a5b3336ac8392ce99a1a12333720857a..225a6419f7b2141328abc5092d025a6047b71913 100644 (file)
@@ -7184,11 +7184,16 @@ void Server::handle_client_mkdir(const MDRequestRef& mdr)
   // it's a directory.
   dn->push_projected_linkage(newi);
 
-  auto _inode = newi->_get_inode();
+  auto* _inode = newi->_get_inode();
   _inode->version = dn->pre_dirty();
   _inode->rstat.rsubdirs = 1;
   _inode->accounted_rstat = _inode->rstat;
   _inode->update_backtrace();
+  if (auto* csp = diri->get_charmap()) {
+    dout(20) << " with " << *csp << dendl;
+    auto& c = _inode->set_charmap();
+    c = *csp;
+  }
 
   snapid_t follows = mdcache->get_global_snaprealm()->get_newest_seq();
   SnapRealm *realm = dn->get_dir()->inode->find_snaprealm();