]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/: find_object_context: return obc for head for snapdir if non null 6015/head
authorSamuel Just <sjust@redhat.com>
Thu, 17 Sep 2015 17:54:18 +0000 (10:54 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 17 Sep 2015 23:53:07 +0000 (16:53 -0700)
The head obc may have an in progress operation holding a lock, we
need to block on the lock for ordering reasons.

Fixes: #13143
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index 52bb6deff9da2de66eb4fa89d24f40e920d57c52..b89aa2e32ff4006695d11925aec2b8073ab035d7 100644 (file)
@@ -8418,13 +8418,16 @@ int ReplicatedPG::find_object_context(const hobject_t& oid,
   // want the snapdir?
   if (oid.snap == CEPH_SNAPDIR) {
     // return head or snapdir, whichever exists.
-    ObjectContextRef obc = get_object_context(head, can_create);
+    ObjectContextRef headobc = get_object_context(head, can_create);
+    ObjectContextRef obc = headobc;
     if (!obc || !obc->obs.exists)
       obc = get_object_context(oid, can_create);
     if (!obc || !obc->obs.exists) {
       // if we have neither, we would want to promote the head.
       if (pmissing)
        *pmissing = head;
+      if (pobc)
+       *pobc = headobc; // may be null
       return -ENOENT;
     }
     dout(10) << "find_object_context " << oid