]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/rados: Set locator key when exporting or importing a pool 36408/head
authorIain Buclaw <iain.buclaw@dunnhumby.com>
Wed, 4 Mar 2020 14:32:43 +0000 (15:32 +0100)
committerKefu Chai <kchai@redhat.com>
Tue, 4 Aug 2020 04:46:30 +0000 (12:46 +0800)
Fixes the following error when exporting a pool that contains objects
with a locator key set:

        error getting xattr set [object name]: (2) No such file or directory
        error from export: (2) No such file or directory

Fixes: https://tracker.ceph.com/issues/46824
Signed-off-by: Iain Buclaw <iain.buclaw@dunnhumby.com>
src/tools/rados/PoolDump.cc
src/tools/rados/RadosImport.cc

index 747e9c62dbc41fb17cbe1ce3deb2d40f8251043a..9bfafa107dc652f7da25ce44e8123bc8ed2e2b4b 100644 (file)
@@ -70,6 +70,7 @@ int PoolDump::dump(IoCtx *io_ctx)
     const uint32_t op_size = 4096 * 1024;
     uint64_t offset = 0;
     io_ctx->set_namespace(i->get_nspace());
+    io_ctx->locator_set_key(i->get_locator());
     while (true) {
       bufferlist outdata;
       r = io_ctx->read(oid, outdata, op_size, offset);
index afc04cf309e6a08ade399ded262a9aa155079051..0a901b70945961a6c81173c6d067d9885ef9e59b 100644 (file)
@@ -194,6 +194,7 @@ int RadosImport::get_object_rados(librados::IoCtx &ioctx, bufferlist &bl, bool n
   }
 
   ioctx.set_namespace(ob.hoid.hobj.get_namespace());
+  ioctx.locator_set_key(ob.hoid.hobj.get_key());
 
   string msg("Write");
   skipping = false;