New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mon: don't require OSD W for MRemoveSnaps #6601
Conversation
Related: http://tracker.ceph.com/issues/13777 |
@@ -2271,7 +2271,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, false, false)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MonCapGrant("mon", MON_CAP_R) is enough to make is_capable(..., true, false, false) return true. I think we should set parameter op_may_write or parameter op_may_exec to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the 'return MON_CAP_ALL' line in MonCapGrant::get_allowed()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, you're right. I've updated it
c52bee2
to
9dfae25
Compare
Are we missing anything about this change, @jecluis? |
looks good |
Use ability to execute "osd pool rmsnap" command as a signal that the client should be permitted to send MRemoveSnaps too. Note that we don't also require the W ability, unlike Monitor::_allowed_command -- this is slightly more permissive handling, but anyone crafting caps that explicitly permit "osd pool rmsnap" needs to know what they are doing. Fixes: ceph#13777 Signed-off-by: John Spray <john.spray@redhat.com>
See the new TestStrays.test_snapshot_remove passing here http://pulpito.ceph.com/jspray-2015-11-30_02:06:10-fs-wip-testing-jcsp---basic-multi/1163869 (merge ceph/ceph-qa-suite#728 at the same time as this) |
@gregsfortytwo were you waiting for @jecluis on this? |
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>
Use ability to execute "osd pool rmsnap" command
as a signal that the client should be permitted
to send MRemoveSnaps too.
Note that we don't also require the W ability,
unlike Monitor::_allowed_command -- this is slightly
more permissive handling, but anyone crafting caps
that explicitly permit "osd pool rmsnap" needs to
know what they are doing.
Signed-off-by: John Spray john.spray@redhat.com