]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: update_features should handle Infernalis OSDs 11462/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 20 Sep 2016 18:47:36 +0000 (14:47 -0400)
committerLoic Dachary <ldachary@redhat.com>
Thu, 13 Oct 2016 08:24:37 +0000 (10:24 +0200)
Fixes: http://tracker.ceph.com/issues/17330
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 8cb2ccda1b847e0f33c0d34bf57e9ec29bbbb43b)

src/librbd/internal.cc

index a999f6f79b0d178018e9d8f50e5f6cdea0b7a243..b733c13ef6e235072964e01893fe72beac28afe5 100644 (file)
@@ -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;