On promote we use finish_ctx to build the final log entries, and need to
encode the snaps vector in that case. (Normally this is done by
make_writeable or explicitly by the snap trimmer.)
Signed-off-by: Sage Weil <sage@inktank.com>
ctx->obs->oi.version,
ctx->user_at_version, ctx->reqid,
ctx->mtime));
+ if (soid.snap < CEPH_NOSNAP) {
+ dout(20) << __func__ << " encoding snaps " << ctx->new_obs.oi.snaps << dendl;
+ ::encode(ctx->new_obs.oi.snaps, ctx->log.back().snaps);
+ }
// apply new object state.
ctx->obc->obs = ctx->new_obs;