]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG::_rollback_to: update the OMAP flag 8495/head
authorSamuel Just <sjust@redhat.com>
Fri, 1 Apr 2016 18:33:40 +0000 (11:33 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 1 Apr 2016 21:38:12 +0000 (14:38 -0700)
We don't simply copy over the whole flag field because not all values
should necessarily be carried over from the clone.  Particularly,
FLAG_CACHE_PIN should not be overridden.

Fixes: http://tracker.ceph.com/issues/14777
Backport: hammer, infernalis
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index abefb0066c74ba9eb5371a07329744edfd16bcd2..a62ad628717e1ddaede0f450bd9cbae8ae338c87 100644 (file)
@@ -6181,6 +6181,15 @@ int ReplicatedPG::_rollback_to(OpContext *ctx, ceph_osd_op& op)
        obs.oi.set_omap_digest(rollback_to->obs.oi.omap_digest);
       else
        obs.oi.clear_omap_digest();
+
+      if (rollback_to->obs.oi.is_omap()) {
+       dout(10) << __func__ << " setting omap flag on " << obs.oi.soid << dendl;
+       obs.oi.set_flag(object_info_t::FLAG_OMAP);
+      } else {
+       dout(10) << __func__ << " clearing omap flag on " << obs.oi.soid << dendl;
+       obs.oi.clear_flag(object_info_t::FLAG_OMAP);
+      }
+
       snapset.head_exists = true;
     }
   }