From 8e1cc88e068fe57e9bbfa1ebbc6bbf89fb62aaac Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Wed, 2 Nov 2016 12:43:45 +0200 Subject: [PATCH] rbd-mirror: snap protect of non-layered image results in split-brain Fixes: http://tracker.ceph.com/issues/16962 Signed-off-by: Mykola Golub --- src/librbd/Operations.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/librbd/Operations.cc b/src/librbd/Operations.cc index 63dacf9430d..feb99ed4a98 100644 --- a/src/librbd/Operations.cc +++ b/src/librbd/Operations.cc @@ -1020,6 +1020,11 @@ int Operations::snap_protect(const char *snap_name) { return -EROFS; } + if (!m_image_ctx.test_features(RBD_FEATURE_LAYERING)) { + lderr(cct) << "image must support layering" << dendl; + return -ENOSYS; + } + int r = m_image_ctx.state->refresh_if_required(); if (r < 0) { return r;