]> 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>
Thu, 27 Feb 2025 18:41:55 +0000 (13:41 -0500)
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Fixes: https://tracker.ceph.com/issues/66373
src/mds/Server.cc

index 6e106230bf9bd361fe61269e451df32d26f64c03..12ae35eb2606db3e20e47a022d7ae0af0993cf9c 100644 (file)
@@ -7235,11 +7235,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();