From eef7466a5cfea679d43d8be13a99ab080660bdad Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Mon, 23 Feb 2015 20:51:23 -0800 Subject: [PATCH] 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 --- src/librbd/internal.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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); -- 2.39.5