]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: Don't export temporary objects until we have persistent-temp objects
authorDavid Zafman <dzafman@redhat.com>
Mon, 22 Jun 2015 18:15:58 +0000 (11:15 -0700)
committerDavid Zafman <dzafman@redhat.com>
Thu, 25 Feb 2016 20:50:23 +0000 (12:50 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 4fcf5dd370e8cfac75fadbf709a785053eb26ad9)

Remove "assert(!i->hobj.is_meta());" since is_meta() is not in Hammer

src/tools/ceph_objectstore_tool.cc

index 5a57ecb841d019b05e8f408c101c719993f9b8f6..1fcfe16ec8c95578bfe5fe44ffe3d66fa8e226e7 100644 (file)
@@ -1095,7 +1095,7 @@ int export_files(ObjectStore *store, coll_t coll)
     for (vector<ghobject_t>::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;