From 3d99ecd6131f41ebe60c352266dca9193d61bbc9 Mon Sep 17 00:00:00 2001 From: David Zafman Date: Mon, 22 Jun 2015 11:15:58 -0700 Subject: [PATCH] tools: Don't export temporary objects until we have persistent-temp objects Signed-off-by: David Zafman (cherry picked from commit 4fcf5dd370e8cfac75fadbf709a785053eb26ad9) Remove "assert(!i->hobj.is_meta());" since is_meta() is not in Hammer --- src/tools/ceph_objectstore_tool.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 5a57ecb841d..1fcfe16ec8c 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -1095,7 +1095,7 @@ int export_files(ObjectStore *store, coll_t coll) for (vector::iterator i = objects.begin(); i != objects.end(); ++i) { - if (i->is_pgmeta()) { + if (i->is_pgmeta() || i->hobj.is_temp()) { continue; } r = export_file(store, coll, *i); @@ -1590,6 +1590,10 @@ int get_object(ObjectStore *store, coll_t coll, bufferlist &bl, OSDMap &curmap, coll.is_pg_prefix(pg); SnapMapper mapper(&driver, 0, 0, 0, pg.shard); + if (ob.hoid.hobj.is_temp()) { + cerr << "ERROR: Export contains temporary object '" << ob.hoid << "'" << std::endl; + return -EFAULT; + } assert(g_ceph_context); if (ob.hoid.hobj.nspace != g_ceph_context->_conf->osd_hit_set_namespace) { object_t oid = ob.hoid.hobj.oid; -- 2.47.3