From 32d84e0eed671f0cfe37057d59f0afe1b63f3c4d Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 20 Sep 2016 14:47:36 -0400 Subject: [PATCH] librbd: update_features should handle Infernalis OSDs Fixes: http://tracker.ceph.com/issues/17330 Signed-off-by: Jason Dillaman (cherry picked from commit 8cb2ccda1b847e0f33c0d34bf57e9ec29bbbb43b) --- src/librbd/internal.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index a999f6f79b0d1..b733c13ef6e23 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; -- 2.39.5