]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use client or pool snapc based on _pool_ snap mode, not client op
authorSage Weil <sage@newdream.net>
Thu, 15 Jul 2010 17:43:31 +0000 (10:43 -0700)
committerSage Weil <sage@newdream.net>
Thu, 15 Jul 2010 17:43:31 +0000 (10:43 -0700)
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>
src/osd/ReplicatedPG.cc

index 6ecf48f4cf1577dc04c6e534820f4fae9f80bd06..a1f2fca40ca36f1987e3fd6186de36156eb6df0c 100644 (file)
@@ -514,13 +514,13 @@ void ReplicatedPG::do_op(MOSDOp *op)
 
   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) {