]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: do_op: move up LIST_SNAPS specialness
authorSage Weil <sage@redhat.com>
Fri, 1 Sep 2017 01:06:29 +0000 (21:06 -0400)
committerSage Weil <sage@redhat.com>
Mon, 11 Sep 2017 14:13:34 +0000 (09:13 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PrimaryLogPG.cc

index d411615829e8c76e4bee2456c5fdd010613cecc1..b9a78e36495278ac5583d2fc7e95ce71ba16c43a 100644 (file)
@@ -2119,6 +2119,13 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
     m->has_flag(CEPH_OSD_FLAG_MAP_SNAP_CLONE),
     &missing_oid);
 
+  // LIST_SNAPS needs the ssc too
+  if (obc &&
+      m->get_snapid() == CEPH_SNAPDIR &&
+      !obc->ssc) {
+    obc->ssc = get_snapset_context(oid, true);
+  }
+
   if (r == -EAGAIN) {
     // If we're not the primary of this OSD, we just return -EAGAIN. Otherwise,
     // we have to wait for the object.
@@ -9757,11 +9764,6 @@ int PrimaryLogPG::find_object_context(const hobject_t& oid,
             << dendl;
     *pobc = obc;
 
-    // always populate ssc for SNAPDIR...
-    if (!obc->ssc)
-      obc->ssc = get_snapset_context(
-       oid, true);
-    return 0;
   }
 
   // we want a snap