]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: update_features should handle Infernalis OSDs 11155/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 20 Sep 2016 18:47:36 +0000 (14:47 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 20 Sep 2016 18:52:34 +0000 (14:52 -0400)
Fixes: http://tracker.ceph.com/issues/17330
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/internal.cc

index 78b0057db841da24e328ba79d83df03444b9326f..ecc0f28a6793e46139af0f788e48c5647185963d 100644 (file)
@@ -1849,6 +1849,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;