Adam C. Emerson [Thu, 18 May 2017 14:20:31 +0000 (10:20 -0400)]
Merge branch pull request #13551 from pritha-srivastava/wip-rgw-role-tenant
rgw: Replaced rgw userid with tenant in ARN for Roles.
rgw: Adding roles under the scope of tenants.
rgw: Added code for Role input validation.
rgw: Added code to fetch a role by its id.
rgw: Added code to allow tenant name as part of role name also.
rgw: Better reporting of missing input values in case of radosgw-admin
commands for Roles.
Reviewed-By: Adam C. Emerson <aemerson@redhat.com>
Bassam Tabbara [Thu, 18 May 2017 00:41:16 +0000 (17:41 -0700)]
cmake: workaound ccache issue with .S assembly files
when building with -DWITH_CCACHE=ON recent versions of ccache
(for example 3.3.3) seem to mangle object files from the cache
for source files that have a .S extension. This seems similar
but unrelated to PR #14633. The workaround here is to rename .S
files to .s (lower case).
Adam C. Emerson [Wed, 17 May 2017 20:06:23 +0000 (16:06 -0400)]
Merge branch 'wip-sts-authorization'
Merge pull request #14307 from adamemerson/wip-sts-authorization
common: Add make_unique
submodule: Tencent's RapidJSON library
common: Add ISO-8601 Date Support
rgw: Add is_identity to AuthApplier class
rgw: Move globbing flags to header
buffer: Make the use of static areas more convenient
rgw: Add basic support for IAM policies
rgw: Build bucket permission and environment in req_state
rgw: Verify policies as WELL as ACLs
rgw: RESTful bucket policy ops
rgw: Write documentation for bucket policies
Adam C. Emerson [Thu, 28 Jul 2016 17:35:08 +0000 (13:35 -0400)]
submodule: Tencent's RapidJSON library
This is a high performance, MIT licensed JSON parsing library. It
provides a SAX interface so that I can compile an S3 policy without
building up a JSONObject tree in the middle that gets thrown away.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Casey Bodley [Tue, 16 May 2017 22:18:47 +0000 (18:18 -0400)]
osd: fix argument-dependent lookup of swap()
because include/types.h has a 'using namespace std', the call to
::swap() had previously been selecting overloads from namespace std. but
once any other swap() functions are present in the global namespace,
argument-dependent lookup [1] will not consider those from std
for example, when common/sstring.hh has been included, its global swap()
function is the only overload considered, so calls to ::swap() result in
errors like this:
/home/cbodley/ceph/src/osd/osd_types.h: In member function ‘void ObjectModDesc::swap(ObjectModDesc&)’:
/home/cbodley/ceph/src/osd/osd_types.h:3135:56: error: no matching function for call to ‘swap(bool&, bool&)’
::swap(other.can_local_rollback, can_local_rollback);
^
/home/cbodley/ceph/src/common/sstring.hh:589:6: note: candidate: template<class char_type, class size_type, size_type max_size> void swap(basic_sstring<char_type, size_type, Max>&, basic_sstring<char_type, size_type, Max>&)
void swap(basic_sstring<char_type, size_type, max_size>& x,
^
/home/cbodley/ceph/src/common/sstring.hh:589:6: note: template argument deduction/substitution failed:
/home/cbodley/ceph/src/osd/osd_types.h:3135:56: note: mismatched types ‘basic_sstring<char_type, size_type, Max>’ and ‘bool’
::swap(other.can_local_rollback, can_local_rollback);
adding a `using std::swap;` to the calling scope and removing :: from
the call to `swap()` allows argument-dependent lookup to resolve the
overloads in both namespaces
John Spray [Tue, 16 May 2017 12:28:48 +0000 (13:28 +0100)]
ceph-create-keys: update client.admin if it already exists
This means that anyone who de-privileges their client.admin
user will find that it gets resets with full privileges again.
This is necessary because we cannot distinguish between an old
key and a deliberately de-privileged key, and it's okay because
this is the admin key, it's meant to have access to everything.
Fixes: http://tracker.ceph.com/issues/19940 Signed-off-by: John Spray <john.spray@redhat.com>
rgw: Searching for error codes and dumping output based on protocol flags.
The previous commit uses dynamic allocation to search for s3/ swift specific
error codes and dump the results. In order to avoid dynamic allocation,
we are making use of protocol flags to achieve the above.
Marcus Watts [Tue, 3 Nov 2015 00:43:36 +0000 (19:43 -0500)]
polymorphic error codes.
make set_req_state_err a method of req_state
get rid of params.perr; it's never used
rgw - polymorphic error object.
polymorphic error object: this way sts, which has additional error fields,
and its own xml format for how errors should be produced, can overload
the base rgw_err class.
STL fixup: use real mappings for error mappings, not a linear search.
insubstantiate error mappings exactly once in src/rgw/rgw_common.cc, instead
of multiple copies from every source file that includes src/rgw/rgw_http_errors.h.
remove dump_errno(s, err) - it was never used, and the code looked bogus.
move rgw_http_error_to_errno from header to rgw_rest_client.cc,
the only place it's used.
move rgw_http_status_code and http_codes to rgw_rest.cc,
the only place it's used.
base class (rgw_err) implements s3 errors; swift & sts errors use
the base class and overlay their own additional error codes to
the ones recognized by the base class.
For a while, I was trying to just have a "generic" abort_early() that
used dump_more. Now, I have an op aware form that works the old way.
I would like the http routines to known less about "op" structures,
which is why I'm making this distinction.
Splitting up generic and s3 flavors of some things:
rgw_rest_init() - split into s3 and generic forms.
end_header: s3 vs generic forms: generic form uses dump_more.
abort_early: s3 vs generic forms: generic form uses dump_more, error_content.
And fixing some mistakes from the merge:
Fixup: should not have deleted dump_errno() local storage forms.
Fixup:RGWRESTFlusher - take a dump_more to make it generic.
Fixup: need RGWRESTOp::send_response()
Move swift_err up; use it in bulkdelete_respond
I Think I don't need s->prot_flags when using swift_err.
Matt Benjamin [Mon, 15 May 2017 21:30:29 +0000 (17:30 -0400)]
rgw_file: v3: fix write-timer action
For now, unify with v4 write-on-close path, by calling
RGWFileHandle::close() on write-timer expire, since it will
call write_finish() as a side-effect.
Fixes: http://tracker.ceph.com/issues/19932 Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
John Spray [Mon, 15 May 2017 21:23:42 +0000 (17:23 -0400)]
qa: simplify TestJournalRepair
This was sending lots of metadata ops to MDSs to persuade
them to migrate some subtrees, but that was flaky. Use
the shiny new rank pinning functionality instead.
Michael Sevilla [Wed, 3 May 2017 16:05:56 +0000 (09:05 -0700)]
mds: add perf counters for file system operations
Shows the types of operations that clients are doing by adding counters to the
spot where the MDS responds to clients. This avoids counting operations that
were restarted while waiting for locks or for metadata to load. Does not
support per-client activity. This is the first step towards comprehensive
performance tracking in the file system.
Signed-off-by: Michael Sevilla <mikesevilla3@gmail.com>
Sage Weil [Wed, 3 May 2017 02:11:35 +0000 (21:11 -0500)]
common/perf_counters: histograms are counters
The histogram is a histogram of counters (not guages), so set the COUNTER
bit. (This only matters because we expose and document the bits of the
type, for better for for worse.)