From: Loic Dachary Date: Fri, 14 Nov 2014 00:16:10 +0000 (+0100) Subject: common: do not omit shard when ghobject NO_GEN is set X-Git-Tag: v0.80.8~16^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b4a4b75e6d4deb6818681902f85baa9f63acdb4f;p=ceph.git common: do not omit shard when ghobject NO_GEN is set Do not silence the display of shard_id when generation is NO_GEN. Erasure coded objects JSON representation used by ceph_objectstore_tool need the shard_id to find the file containing the chunk. Minimal testing is added to ceph_objectstore_tool.py http://tracker.ceph.com/issues/10063 Fixes: #10063 Signed-off-by: Loic Dachary (cherry picked from commit dcf09aed121f566221f539106d10283a09f15cf5) Conflicts: src/test/ceph_objectstore_tool.py --- diff --git a/src/common/hobject.cc b/src/common/hobject.cc index ecc8cfde4d715..28cb86a5c4916 100644 --- a/src/common/hobject.cc +++ b/src/common/hobject.cc @@ -238,10 +238,10 @@ void ghobject_t::decode(bufferlist::iterator& bl) void ghobject_t::dump(Formatter *f) const { hobj.dump(f); - if (generation != NO_GEN) { + if (generation != NO_GEN) f->dump_int("generation", generation); + if (shard_id != ghobject_t::NO_SHARD) f->dump_int("shard_id", shard_id); - } } void ghobject_t::generate_test_instances(list& o)