]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: finish_ctx: do not assume that the oi is for the head object
authorSamuel Just <sjust@redhat.com>
Thu, 5 Mar 2015 21:59:41 +0000 (13:59 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 13 Mar 2015 22:29:50 +0000 (15:29 -0700)
If we are setting the oi on the clone object, we want to update the
mod_desc.

Fixes: 11027
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index aebcbf75245c235ffcd0e08458a153e3db6588a6..cb475a48d3e1740b8ea77ac8bf8aead5c6ba11d1 100644 (file)
@@ -6002,18 +6002,19 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type, bool maintain_ssc
       dout(10) << " final snapset " << ctx->new_snapset
               << " in " << soid << dendl;
       setattr_maybe_cache(ctx->obc, ctx, ctx->op_t, SS_ATTR, bss);
+    } else {
+      dout(10) << " no snapset (this is a clone)" << dendl;
+    }
 
-      if (pool.info.require_rollback()) {
-       set<string> changing;
-       changing.insert(OI_ATTR);
+    if (pool.info.require_rollback()) {
+      set<string> changing;
+      changing.insert(OI_ATTR);
+      if (!soid.is_snap())
        changing.insert(SS_ATTR);
-       ctx->obc->fill_in_setattrs(changing, &(ctx->mod_desc));
-      } else {
-       // replicated pools are never rollbackable in this case
-       ctx->mod_desc.mark_unrollbackable();
-      }
+      ctx->obc->fill_in_setattrs(changing, &(ctx->mod_desc));
     } else {
-      dout(10) << " no snapset (this is a clone)" << dendl;
+      // replicated pools are never rollbackable in this case
+      ctx->mod_desc.mark_unrollbackable();
     }
   } else {
     ctx->new_obs.oi = object_info_t(ctx->obc->obs.oi.soid);