From e0ec2865014b5ac32c7e4e4427c7d6f8681f3736 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 17 Apr 2012 00:14:19 -0700 Subject: [PATCH] objecter: recalc pgid in case it wasn't a precalculated pgid We had an issue where we didn't call it since we relied on the existance of the object name and we were passed an empty one. However, we still need to handle the case of list_objects, where we don't want to recalc pgid. Signed-off-by: Yehuda Sadeh --- src/osdc/Objecter.cc | 3 ++- src/osdc/Objecter.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 24b95d2c8422e..acd4ef74e8086 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -974,7 +974,7 @@ int Objecter::recalc_op_target(Op *op) { vector acting; pg_t pgid = op->pgid; - if (op->oid.name.length()) { + if (!op->precalc_pgid) { int ret = osdmap->object_locator_to_pg(op->oid, op->oloc, pgid); if (ret == -ENOENT) return RECALC_OP_TARGET_POOL_DNE; @@ -1349,6 +1349,7 @@ void Objecter::list_objects(ListContext *list_context, Context *onfinish) { o->reply_epoch = &onack->epoch; o->pgid = pg_t(list_context->current_pg, list_context->pool_id, -1); + o->precalc_pgid = true; op_submit(o); } diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index e733d3373e7c6..d90e314d1e0de 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -598,6 +598,8 @@ public: utime_t stamp; + bool precalc_pgid; + Op(const object_t& o, const object_locator_t& ol, vector& op, int f, Context *ac, Context *co, eversion_t *ov) : session(NULL), session_item(this), incarnation(0), @@ -607,7 +609,7 @@ public: outbl(NULL), flags(f), priority(0), onack(ac), oncommit(co), tid(0), attempts(0), - paused(false), objver(ov), reply_epoch(NULL) { + paused(false), objver(ov), reply_epoch(NULL), precalc_pgid(false) { ops.swap(op); /* initialize out_* to match op vector */ -- 2.39.5