]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ignore -EOPNOTSUPP errors when retrieving image group membership 27080/head
authorJason Dillaman <dillaman@redhat.com>
Wed, 20 Mar 2019 18:40:50 +0000 (14:40 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 20 Mar 2019 18:40:50 +0000 (14:40 -0400)
The Luminous release did not support adding images to a group (it only
included the bare-minimum support for creating groups). Commit f76df32666b
incorrectly dropped support for ignoring this possible failure. This
prevents Nautilus-release clients from opening images contained within
a Luminous-release cluster.

Fixes: http://tracker.ceph.com/issues/38834
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/image/RefreshRequest.cc
src/test/librbd/image/test_mock_RefreshRequest.cc

index ec290a957ec547363b2442629a75fee93bf7a6e0..a79ffb7f293a1ba2e0884fd9d042bfd3da621977 100644 (file)
@@ -664,7 +664,7 @@ Context *RefreshRequest<I>::handle_v2_get_group(int *result) {
     auto it = m_out_bl.cbegin();
     cls_client::image_group_get_finish(&it, &m_group_spec);
   }
-  if (*result < 0) {
+  if (*result < 0 && *result != -EOPNOTSUPP) {
     lderr(cct) << "failed to retrieve group: " << cpp_strerror(*result)
                << dendl;
     return m_on_finish;
index 414303b036b3f8d5cc16f2261a8102bf8701ea59..777373c99663c0c6379d401920fc07534fdd94f1 100644 (file)
@@ -548,7 +548,7 @@ TEST_F(TestMockImageRefreshRequest, SuccessV2) {
   expect_get_parent(mock_image_ctx, 0);
   expect_get_metadata(mock_image_ctx, 0);
   expect_apply_metadata(mock_image_ctx, 0);
-  expect_get_group(mock_image_ctx, 0);
+  expect_get_group(mock_image_ctx, -EOPNOTSUPP);
   expect_refresh_parent_is_required(mock_refresh_parent_request, false);
   if (ictx->test_features(RBD_FEATURE_EXCLUSIVE_LOCK)) {
     expect_init_exclusive_lock(mock_image_ctx, mock_exclusive_lock, 0);