From: Josh Durgin Date: Tue, 24 Feb 2015 04:51:23 +0000 (-0800) Subject: librbd: apply flag read failure to all snaps X-Git-Tag: v0.93~6^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=eef7466a5cfea679d43d8be13a99ab080660bdad;p=ceph.git librbd: apply flag read failure to all snaps 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 --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index f00cb40a142b1..95ea2926627d7 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -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 default_flags(new_snapc.snaps.size(), ictx->flags); snap_flags.swap(default_flags);