The pool snap mode determines where the snapc should come from. In
particular, if the client specifies no snap seq, but the pool is in
unmanaged snap mode, then use the client (empty) snapc, and do not generate
one from the pool.
The pool might have a snap seq that is > 0, leading to and totally
invalid(!) snapc like 2=[], e.g., because the pool seq was bumped to create
an unmanaged snapc by another client.
Signed-off-by: Sage Weil <sage@newdream.net>
if (op->may_write()) {
// snap
- if (op->get_snap_seq()) {
+ if (pool->is_pool_snaps_mode()) {
+ // use pool's snapc
+ ctx->snapc = pool->snapc;
+ } else {
// client specified snapc
ctx->snapc.seq = op->get_snap_seq();
ctx->snapc.snaps = op->get_snaps();
- } else {
- // use pool's snapc
- ctx->snapc = pool->snapc;
}
if ((op->get_flags() & CEPH_OSD_FLAG_ORDERSNAP) &&
ctx->snapc.seq < obc->obs.ssc->snapset.seq) {