From: Jason Dillaman Date: Tue, 20 Sep 2016 18:47:36 +0000 (-0400) Subject: librbd: update_features should handle Infernalis OSDs X-Git-Tag: v10.2.4~31^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11462%2Fhead;p=ceph.git librbd: update_features should handle Infernalis OSDs Fixes: http://tracker.ceph.com/issues/17330 Signed-off-by: Jason Dillaman (cherry picked from commit 8cb2ccda1b847e0f33c0d34bf57e9ec29bbbb43b) --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index a999f6f79b0d..b733c13ef6e2 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;