summaryrefslogtreecommitdiffstats
path: root/src/mds/CInode.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds/CInode.cc')
-rw-r--r--src/mds/CInode.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc
index 0e9b6996ad2..dfad411d323 100644
--- a/src/mds/CInode.cc
+++ b/src/mds/CInode.cc
@@ -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();
}
}