diff options
author | Gregory Farnum <greg@gregs42.com> | 2015-12-07 06:03:25 +0100 |
---|---|---|
committer | Gregory Farnum <greg@gregs42.com> | 2015-12-07 06:03:25 +0100 |
commit | b1d5c48187e19b22c973b2404e70aea09be8db94 (patch) | |
tree | 8c69240d20691430e432412245de596225a93ad9 | |
parent | Merge pull request #6811 from smithfarm/wip-submitting-jewel (diff) | |
parent | mon: don't require OSD W for MRemoveSnaps (diff) | |
download | ceph-b1d5c48187e19b22c973b2404e70aea09be8db94.tar.xz ceph-b1d5c48187e19b22c973b2404e70aea09be8db94.zip |
Merge pull request #6601 from jcsp/wip-13777-caps
mon: don't require OSD W for MRemoveSnaps
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
-rw-r--r-- | src/mon/MonCap.cc | 2 | ||||
-rw-r--r-- | src/mon/OSDMonitor.cc | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/mon/MonCap.cc b/src/mon/MonCap.cc index 989893b2026..a2540b56411 100644 --- a/src/mon/MonCap.cc +++ b/src/mon/MonCap.cc @@ -134,6 +134,8 @@ void MonCapGrant::expand_profile(EntityName name) const profile_grants.push_back(MonCapGrant("mds", MON_CAP_ALL)); profile_grants.push_back(MonCapGrant("mon", MON_CAP_R)); profile_grants.push_back(MonCapGrant("osd", MON_CAP_R)); + // This command grant is checked explicitly in MRemoveSnaps handling + profile_grants.push_back(MonCapGrant("osd pool rmsnap")); profile_grants.push_back(MonCapGrant("log", MON_CAP_W)); } if (profile == "osd" || profile == "mds" || profile == "mon") { diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ca10faad650..040332c823a 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2278,7 +2278,8 @@ bool OSDMonitor::preprocess_remove_snaps(MonOpRequestRef op) MonSession *session = m->get_session(); if (!session) goto ignore; - if (!session->is_capable("osd", MON_CAP_R | MON_CAP_W)) { + if (!session->caps.is_capable(g_ceph_context, session->entity_name, + "osd", "osd pool rmsnap", {}, true, true, false)) { dout(0) << "got preprocess_remove_snaps from entity with insufficient caps " << session->caps << dendl; goto ignore; |