Skip to content

Commit 706eb26

Browse files
committed
mds: do not dump empty bufptr
Fixes: https://tracker.ceph.com/issues/68243 Signed-off-by: Patrick Donnelly <[email protected]>
1 parent ac5b3f9 commit 706eb26

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mds/CInode.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4589,8 +4589,11 @@ void InodeStoreBase::dump(Formatter *f) const
45894589
for (const auto& [key, val] : *xattrs) {
45904590
f->open_object_section("xattr");
45914591
f->dump_string("key", key);
4592-
std::string v(val.c_str(), val.length());
4593-
f->dump_string("val", v);
4592+
if (val.length()) {
4593+
f->dump_string("val", std::string(val.c_str(), val.length()));
4594+
} else {
4595+
f->dump_string("val", "");
4596+
}
45944597
f->close_section();
45954598
}
45964599
}

0 commit comments

Comments
 (0)