From: John Spray Date: Wed, 10 Jun 2015 11:26:46 +0000 (+0100) Subject: tools: better error message in objectstoretool X-Git-Tag: v9.0.3~203^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1d61963464cc4b7d984d50591cd3e7d25445278;p=ceph.git tools: better error message in objectstoretool ...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 --- diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 36362229a19c..dbc06d66e517 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -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; }