]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Objecter: be careful about precalculated pgids
authorGreg Farnum <greg@inktank.com>
Thu, 29 Aug 2013 20:52:35 +0000 (13:52 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 30 Aug 2013 21:06:33 +0000 (14:06 -0700)
The only current user of the precalc_pgid field is list_objects. That's
fine, but we don't want new users to inadvertently appear and somehow
break the caching/tiering stuff by forcing us to go to the base pool
when we should be talking to somebody else. Add an assert to catch
these cases.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/osdc/Objecter.cc

index 888d0694470f36d507d6f35f8f9f265375364aea..26741a94a080f73e64187d834fc91f54e5f850c8 100644 (file)
@@ -1299,6 +1299,7 @@ int Objecter::recalc_op_target(Op *op)
   pg_t pgid = op->pgid;
   op->target_oloc = op->base_oloc;
   if (op->precalc_pgid) {
+    assert(op->oid.name.empty()); // make sure this is a listing op
     ldout(cct, 10) << "recalc_op_target have " << pgid << " pool " << osdmap->have_pg_pool(pgid.pool()) << dendl;
     if (!osdmap->have_pg_pool(pgid.pool()))
       return RECALC_OP_TARGET_POOL_DNE;