]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: apply flag read failure to all snaps
authorJosh Durgin <jdurgin@redhat.com>
Tue, 24 Feb 2015 04:51:23 +0000 (20:51 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Thu, 26 Feb 2015 01:27:33 +0000 (17:27 -0800)
Don't check just the features of head, since it may be possible to
disable object map in the future.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/librbd/internal.cc

index f00cb40a142b16ce01a66fa36f518b4f29b485c8..95ea2926627d7c8738fba4b9a16bdd894cfb2796 100644 (file)
@@ -1964,15 +1964,12 @@ reprotect_and_return_err:
            r = cls_client::get_flags(&ictx->md_ctx, ictx->header_oid,
                                      &ictx->flags, new_snapc.snaps,
                                      &snap_flags);
-            if (r == -EOPNOTSUPP || r == -EIO) {
-              // Older OSD doesn't support RBD flags, need to assume the worst
-              ldout(ictx->cct, 10) << "OSD does not support RBD flags" << dendl;
-              ictx->flags = 0;
-              if ((ictx->features & RBD_FEATURE_OBJECT_MAP) != 0) {
-                ldout(ictx->cct, 10) << "disabling object map optimizations"
-                                     << dendl;
-                ictx->flags |= RBD_FLAG_OBJECT_MAP_INVALID;
-              }
+           if (r == -EOPNOTSUPP || r == -EIO) {
+             // Older OSD doesn't support RBD flags, need to assume the worst
+             ldout(ictx->cct, 10) << "OSD does not support RBD flags"
+                                  << "disabling object map optimizations"
+                                  << dendl;
+             ictx->flags = RBD_FLAG_OBJECT_MAP_INVALID;
 
              vector<uint64_t> default_flags(new_snapc.snaps.size(), ictx->flags);
              snap_flags.swap(default_flags);