From 5e13884acc4037f3bd6263a9d273e7cee7c8fc81 Mon Sep 17 00:00:00 2001
From: Sage Weil <sage@redhat.com>
Date: Fri, 1 Sep 2017 13:37:48 -0400
Subject: [PATCH] osd/PrimaryLogPG: find_object_context: drop !head_exists path

Signed-off-by: Sage Weil <sage@redhat.com>
---
 src/osd/PrimaryLogPG.cc | 28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc
index 6588da6ee8a..ae08d738d09 100644
--- a/src/osd/PrimaryLogPG.cc
+++ b/src/osd/PrimaryLogPG.cc
@@ -9716,27 +9716,19 @@ int PrimaryLogPG::find_object_context(const hobject_t& oid,
  
   // head?
   if (oid.snap > ssc->snapset.seq) {
-    if (ssc->snapset.head_exists) {
-      ObjectContextRef obc = get_object_context(head, false);
-      dout(10) << "find_object_context  " << head
-	       << " want " << oid.snap << " > snapset seq " << ssc->snapset.seq
-	       << " -- HIT " << obc->obs
-	       << dendl;
-      if (!obc->ssc)
-	obc->ssc = ssc;
-      else {
-	assert(ssc == obc->ssc);
-	put_snapset_context(ssc);
-      }
-      *pobc = obc;
-      return 0;
-    }
+    ObjectContextRef obc = get_object_context(head, false);
     dout(10) << "find_object_context  " << head
 	     << " want " << oid.snap << " > snapset seq " << ssc->snapset.seq
-	     << " but head dne -- DNE"
+	     << " -- HIT " << obc->obs
 	     << dendl;
-    put_snapset_context(ssc);
-    return -ENOENT;
+    if (!obc->ssc)
+      obc->ssc = ssc;
+    else {
+      assert(ssc == obc->ssc);
+      put_snapset_context(ssc);
+    }
+    *pobc = obc;
+    return 0;
   }
 
   // which clone would it be?