]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not dump empty bufptr 60032/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 27 Sep 2024 17:42:48 +0000 (13:42 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 27 Sep 2024 18:58:19 +0000 (14:58 -0400)
Fixes: https://tracker.ceph.com/issues/68243
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/CInode.cc

index 0e9b6996ad2c5210156ad84f5a00dfd0a293a758..dfad411d323d8b416ccb6819cc888dfc25aa1054 100644 (file)
@@ -4589,8 +4589,11 @@ void InodeStoreBase::dump(Formatter *f) const
     for (const auto& [key, val] : *xattrs) {
       f->open_object_section("xattr");
       f->dump_string("key", key);
-      std::string v(val.c_str(), val.length());
-      f->dump_string("val", v);
+      if (val.length()) {
+        f->dump_string("val", std::string(val.c_str(), val.length()));
+      } else {
+        f->dump_string("val", "");
+      }
       f->close_section();
     }
   }