From 881f4be3a67bc4cdfea69a74ed9d5d26ec6ed4af Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 31 Aug 2017 21:06:29 -0400 Subject: [PATCH] osd/PrimaryLogPG: do_op: move up LIST_SNAPS specialness Signed-off-by: Sage Weil --- src/osd/PrimaryLogPG.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index d411615829e..b9a78e36495 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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