From: Sage Weil Date: Tue, 10 May 2011 15:22:34 +0000 (-0700) Subject: osd: initialize oi.oloc if on-disk value is bogus X-Git-Tag: v0.28~36^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d006c6f2c0aa97c894f631a33d667460fcb0a72d;p=ceph.git osd: initialize oi.oloc if on-disk value is bogus If the on-disk locator is undefined (upgrade of an old cluster?) initialize the oloc fields based on the PG::Info. Reported-by: ar Fred Tested-by: ar Fred Signed-off-by: Sage Weil --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 84399caba867..2f62a866c97e 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -2732,6 +2732,13 @@ ReplicatedPG::ObjectContext *ReplicatedPG::get_object_context(const sobject_t& s } else { object_info_t oi(bv); + + // if the on-disk oloc is bad/undefined, set up the pool value + if (oi.oloc.get_pool() < 0) { + oi.oloc.pool = info.pgid.pool(); + oi.oloc.preferred = info.pgid.preferred(); + } + SnapSetContext *ssc = NULL; if (can_create) ssc = get_snapset_context(soid.oid, true);