]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: set FLAG_SELFMANAGED_SNAPS on cephfs snap removal 21756/head
authorSage Weil <sage@redhat.com>
Tue, 1 May 2018 17:51:55 +0000 (12:51 -0500)
committerSage Weil <sage@redhat.com>
Tue, 1 May 2018 18:46:47 +0000 (13:46 -0500)
CephFS uses a different path to remove selfmanaged snaps than librados,
so while the librados path goes through pg_pool_t::remove_unmanaged_snap(),
we open code the snap addition to the pool's removed_snaps here.  If we
don't set FLAG_SELFMANAGED_SNAPS at that time, we will implicitly set it
during decode and get a CRC mismatch.

Fix by explicitly setting FLAG_SELFMANAGED_SNAPS flag here.

Fixes: http://tracker.ceph.com/issues/23949
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc

index 14082e4c5e8b0d15b2320fd5a9be6d604f7c7e53..8b949ca4b2eb205e53bbb4e5bc40e38e577a25ab 100644 (file)
@@ -3278,6 +3278,7 @@ bool OSDMonitor::prepare_remove_snaps(MonOpRequestRef op)
           !pending_inc.new_pools[p->first].removed_snaps.contains(*q))) {
        pg_pool_t *newpi = pending_inc.get_new_pool(p->first, &pi);
        newpi->removed_snaps.insert(*q);
+       newpi->flags |= pg_pool_t::FLAG_SELFMANAGED_SNAPS;
        dout(10) << " pool " << p->first << " removed_snaps added " << *q
                 << " (now " << newpi->removed_snaps << ")" << dendl;
        if (*q > newpi->get_snap_seq()) {