]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: filter snapc.snaps up front
authorSage Weil <sage@redhat.com>
Tue, 21 Feb 2017 00:22:39 +0000 (18:22 -0600)
committerSage Weil <sage@redhat.com>
Fri, 5 May 2017 17:38:11 +0000 (13:38 -0400)
No reason to wait for make_writeable(); ensure we have a valid snapc
from the start.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PrimaryLogPG.cc

index df4ca618cac663c3aa0151045b5ad984735089db..2ce1aa485519bb48ee74fbe1c71136ed43ef74b4 100644 (file)
@@ -3044,6 +3044,7 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
       // client specified snapc
       ctx->snapc.seq = m->get_snap_seq();
       ctx->snapc.snaps = m->get_snaps();
+      filter_snapc(ctx->snapc.snaps);
     }
     if ((m->has_flag(CEPH_OSD_FLAG_ORDERSNAP)) &&
        ctx->snapc.seq < obc->ssc->snapset.seq) {
@@ -6642,12 +6643,10 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
   if (ctx->new_snapset.seq > snapc.seq) {
     snapc.seq = ctx->new_snapset.seq;
     snapc.snaps = ctx->new_snapset.snaps;
+    filter_snapc(snapc.snaps);
     dout(10) << " using newer snapc " << snapc << dendl;
   }
 
-  if (ctx->obs->exists)
-    filter_snapc(snapc.snaps);
-  
   if ((ctx->obs->exists && !ctx->obs->oi.is_whiteout()) && // head exist(ed)
       snapc.snaps.size() &&                 // there are snaps
       !ctx->cache_evict &&