From bb23599fa8b44878d44861f04a51cbf56ed5a1ba Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 11 Jun 2009 12:49:48 -0700 Subject: [PATCH] osd: fail gracefully if OSDOp.data is empty This happens for MOSDOpReply, currently. --- src/osd/osd_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 6509c975210e8..04cc24f752d23 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -1043,7 +1043,7 @@ inline ostream& operator<<(ostream& out, const OSDOp& op) { } } else if (ceph_osd_op_type_attr(op.op.op)) { // xattr name - if (op.op.name_len) { + if (op.op.name_len && op.data.length()) { out << " "; op.data.write(0, op.op.name_len, out); } @@ -1051,7 +1051,7 @@ inline ostream& operator<<(ostream& out, const OSDOp& op) { out << " (" << op.op.value_len << ")"; } else if (ceph_osd_op_type_exec(op.op.op)) { // class.method - if (op.op.class_len) { + if (op.op.class_len && op.data.length()) { out << " "; op.data.write(0, op.op.class_len, out); out << "."; -- 2.39.5