From 10f8615e8fb27c301c2bb7b22a9fb66fdfba8848 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 20 Feb 2017 18:22:39 -0600 Subject: [PATCH] osd/PrimaryLogPG: filter snapc.snaps up front No reason to wait for make_writeable(); ensure we have a valid snapc from the start. Signed-off-by: Sage Weil --- src/osd/PrimaryLogPG.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index df4ca618cac..2ce1aa48551 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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 &&