]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ignore -EOPNOTSUPP errors when retrieving image group membership
authorJason Dillaman <dillaman@redhat.com>
Wed, 20 Mar 2019 18:40:50 +0000 (14:40 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 30 Mar 2020 15:20:21 +0000 (11:20 -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>
(cherry picked from commit 6f29dc69a0db3b6d982c95ab9d3b9b00a7029e37)

src/librbd/image/RefreshRequest.cc
src/test/librbd/image/test_mock_RefreshRequest.cc

index 8679e179af68d39ee14f39e393796307db0d6336..8a93ee109b158ca2a61e0d662516881e60905c71 100644 (file)
@@ -643,7 +643,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 b871561e9887f2f0bf181925c683f7cea0d73734..9e4fea44b3c9e5459581accf2fc1495104016b80 100644 (file)
@@ -588,7 +588,7 @@ TEST_F(TestMockImageRefreshRequest, SuccessV2) {
   expect_get_metadata(mock_image_ctx, mock_get_metadata_request, RBD_INFO, {},
                       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);