diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index f7bf2e3341101..c90bc33532632 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -414,6 +414,9 @@ int set_features(cls_method_context_t hctx, bufferlist *in, bufferlist *out) return r; } + // newer clients might attempt to mask off features we don't support + mask &= RBD_FEATURES_ALL; + uint64_t enabled_features = features & mask; if ((enabled_features & RBD_FEATURES_MUTABLE) != enabled_features) { CLS_ERR("Attempting to enable immutable feature: %" PRIu64, diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 547afb54a777c..3b36c04b57038 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -1850,6 +1850,13 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force, << "mask=" << features_mask << dendl; r = librbd::cls_client::set_features(&ictx->md_ctx, ictx->header_oid, new_features, features_mask); + if (!enabled && r == -EINVAL) { + // NOTE: infernalis OSDs will not accept a mask with new features, so + // re-attempt with a reduced mask. + features_mask &= ~RBD_FEATURE_JOURNALING; + r = librbd::cls_client::set_features(&ictx->md_ctx, ictx->header_oid, + new_features, features_mask); + } if (r < 0) { lderr(cct) << "failed to update features: " << cpp_strerror(r) << dendl;