mapper.c: fixed array indexing error.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
crush: fix retry histogram array overflow due to indexing error

Signed-off-by: caleb miles <caleb.miles@inktank.com>
Merge branch 'wip-2543' of github.com:ceph/ceph into wip-2543
osd: reimplement OSDCap struct

The old OSDCaps had a few undesireable features:

 - deny
 - weird 'default permissions' semantics when auid matches and no other
   cap is specified
 - difficult to understand, maintain parser

This version is renamed and has a few nice features:

 - spirit grammar for parsing
 - simple internal grant structure with simple semantics
 - support for object prefix maches
 - partial support for per-class (not yet implmeented by the OSD)

Signed-off-by: Sage Weil <sage@inktank.com>
Merge branch 'master' of github.com:ceph/ceph into wip-2543
osdcap: drop unused 'auid' arg from get_cap(), is_match()

The intent was to do a cap like 'allow pools-that-i-own ...', but in
practice you just do 'allow pool <myuid> ...'.. the actual auid you
authenticate as is redundant, since the cap itself is authenticated.

Signed-off-by: Sage Weil <sage@inktank.com>
osdcap: use static const instead of #define

Signed-off-by: Sage Weil <sage@inktank.com>
osdcap: whitespace to make grammar more readable

Signed-off-by: Sage Weil <sage@inktank.com>
osdcap: move semantics of cap check into OSDCap class

The class needs to understand the semantics of possible actions in enough
detail to apply the capabilities it describes, so it makes sense to pass
all of that information into a check method here.  That is preferable to
exposing the internal structure of the capability itself to an external
function to apply the same logic.

Specifically, this fixes the problem where we return the first matching
OSDCapSpec, not a union of all matching specs, and thus fixes a problem
where applying a cap like 'allow r, allow pool foo rwx' to a write
operation in pool foo.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge branch 'master' of github.com:ceph/ceph into wip-2543
objclass: allow class methods to retrieve their triggering entity_inst

Signed-off-by: Greg Farnum <greg@inktank.com>
osdcap: make caps additive

Make 'allow pool foo r, allow pool foo w, allow x' sufficient when you
require rwx for pool foo.

Signed-off-by: Sage Weil <sage@inktank.com>
ceph-authtool: update docs to reflect no more osdcap deny

Signed-off-by: Sage Weil <sage@inktank.com>
nightly push to local repo
osdcap: 'allow rwx pool foo' or 'allow pool foo rwx'

Make the match vs spec order not matter.

Signed-off-by: Sage Weil <sage@inktank.com>
LFNIndex.cc: escape null in append_[un]escaped

Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge remote-tracking branch 'gh/wip-osdcap'

Reviewed-by: Greg Farnum <greg@inktank.com>
librbd: only clear the needs_refresh flag on successful updates.

To support this, add a refresh_seq counter which is incremented every
time we get a notify. This way we can handle the concern from
7add136f907876a20aa2a68297c66b8259afd9a7, in which we get a notify
in the middle of doing a refresh.

Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
cls_rbd: add locking functions.

Users can now place shared or exclusive locks, can remove their own
locks, can break the locks of others, and can list locks. All these
functions are considered PUBLIC_EXEC to match the other rbd methods.

Signed-off-by: Greg Farnum <greg@inktank.com>
cls_rbd: add failure logging to all callers of read_key.

Previously, read_key was printing out error messages when it failed.
But because some callers are fine with it failing on ENOENT, and they
all have more context anyway, it no longer does so and they need
their own logging output. Now they have it.

Signed-off-by: Greg Farnum <greg@inktank.com>