]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: better error message in objectstoretool
authorJohn Spray <john.spray@redhat.com>
Wed, 10 Jun 2015 11:26:46 +0000 (12:26 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 10 Jun 2015 22:50:49 +0000 (23:50 +0100)
...for the case where someone exports a pool
with "rados export" and then tries to import
it into a PG.

Signed-off-by: John Spray <john.spray@redhat.com>
src/tools/ceph_objectstore_tool.cc

index 36362229a19c2fde5b0686e71c03f1daf5c41f5d..dbc06d66e517a5ef3a79026ab3d2968a1fc4ffdf 100644 (file)
@@ -1116,7 +1116,10 @@ int ObjectStoreTool::do_import(ObjectStore *store, OSDSuperblock& sb,
   ret = read_section(&type, &ebl);
   if (ret)
     return ret;
-  if (type != TYPE_PG_BEGIN) {
+  if (type == TYPE_POOL_BEGIN) {
+    cerr << "Pool exports cannot be imported into a PG" << std::endl;
+    return -EINVAL;
+  } else if (type != TYPE_PG_BEGIN) {
     cerr << "Invalid first section type " << type << std::endl;
     return -EFAULT;
   }