Commit Graph

21862 Commits

Author SHA1 Message Date
Tommi Virtanen
dd462ce38b configure.ac: Typo in human-readable description.
Signed-off-by: Tommi Virtanen <tv@inktank.com>
2012-10-09 13:38:45 -07:00
Joao Eduardo Luis
7ef0df25e0 mon: Monitor: resolve keyring option to a file before loading keyring
Otherwise our keyring default location, or any other similarly formatted
location, will be taken as the actual location for the keyring and fail.

Reported-by: tziOm (at) #ceph
Fixes: 3276
Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-10-09 13:36:28 -07:00
Josh Durgin
4eabe57d52 doc: simplify wording for rbd-openstack config
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-09 10:35:02 -07:00
Sage Weil
e3529cf93d Merge remote-tracking branch 'gh/wip-gtest-libcephfs'
Reviewed-by: Sage Weil <sage@inktank.com>
2012-10-09 09:43:42 -07:00
Sam Lang
b83d38a16b doc: Add doxygen style documentation for libcephfs
As well as doxygen doc, we document a few parts of
the interface that are otherwise undocumented and
don't match the standard calls.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-09 10:33:23 -05:00
Sam Lang
9da5b537f2 test: Refactored testceph.cc into gtest framework
Moved all the functionality tests for the libcephfs
API into the gtest framework.  Also adds tests for
directories to improve test coverage of the libcephfs
interfaces.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-09 10:33:11 -05:00
Sam Lang
a00a2406fc test: Allow readdir test to be repeated
Use test dir/files that include the pid to avoid
hitting errors when running the same test twice.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-09 09:17:09 -05:00
Sam Lang
3b5b9ef9be libcephfs: Check that buffer is non-null
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-09 09:17:08 -05:00
Sage Weil
e5de8810e9 Merge remote-tracking branch 'gh/wip-client-stale'
Reviewed-by: Sage Weil <sage@inktank.com>
2012-10-08 20:56:05 -07:00
Sam Lang
323a52ee90 mds: Fix removexattr ENODATA error
If a client sets an xattr and then attempts to remove in a short
time window, the xattr may not have been committed to the journal
and will only be set on the projected xattrs of the inode.  This
results in a removexattr returning ENODATA at present.  The fix
here checks the xattr name in the projected xattrs, and only
returns ENODATA in the case where the name doesn't exist in that
map either.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2012-10-08 20:55:03 -07:00
Sage Weil
629cad59e4 osdmap: fix null deref in dump
CID 731938 (#1 of 1): Dereference after null check (FORWARD_NULL)
At (15): Passing null pointer "f" to function "ceph::Formatter::dump_int(char const *, int64_t)", which dereferences it. (The dereference happens because this is a virtual function call.)

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-08 20:50:12 -07:00
Sage Weil
0406d0c53a osdmap: fix osdmap dump null check
CID 731939 (#1 of 1): Dereference after null check (FORWARD_NULL)
At (5): Passing null pointer "out" to function "std::operator << <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> > &, char const *)", which dereferences it.

Broken by 13b841c746.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-08 20:49:41 -07:00
Sage Weil
5129620ab6 mds: note fall-thru to please coverity
CID 731940 (#1 of 1): Missing break in switch (MISSING_BREAK)
This case (value 23) is not terminated by a 'break' statement.
1719    case CEPH_MSG_CLIENT_RECONNECT:
1720      ALLOW_MESSAGES_FROM(CEPH_ENTITY_TYPE_CLIENT);
The above case falls through to this one.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-08 20:48:30 -07:00
Sage Weil
d68985fddc test_cfuse_cache_invalidate: check for errors
CID 731941 (#1 of 2): Argument cannot be negative (NEGATIVE_RETURNS)
At (6): "fd" is passed to a parameter that cannot be negative.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-08 20:47:16 -07:00
Sage Weil
75bed10850 mon/Elector: fix leak on monmap from peer
CID 731942 (#1 of 1): Resource leak (RESOURCE_LEAK)
At (12): Variable "peermap" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-08 20:44:54 -07:00
Sage Weil
1a28cceb23 test_cfuse_cache_invalidate: zero buffer
CID 731943 (#1 of 1): Uninitialized scalar variable (UNINIT)
At (5): Using uninitialized element of array "buf" when calling "pwrite(int, void const *, size_t, __off64_t)".

Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-08 20:44:10 -07:00
Josh Durgin
97c2f196a3 FileJournal: ignore osd journal size for block devices
Using part of a block device doesn't make much sense. This makes the
common case, where you partition a disk to act as several journals,
easier to configure.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2012-10-08 20:33:43 -07:00
Yehuda Sadeh
df1d17fc4b rgw: switch perm to uint32_t
Should fix a warning.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 16:34:12 -07:00
Yehuda Sadeh
f4a0b2d926 rgw: flexible attr fields
Fixes: #3114
Instead of having a few hard coded attrs that are
special cased, make it more generic. This allows supporting
more header fields, such as cache-control, expires, etc.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 16:14:17 -07:00
Yehuda Sadeh
d4725c06ab rgw: get bucket logging stub
Trivial implementation that just returns that
bucket logging is not enabled.

Fixes: #3225

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:44:04 -07:00
Yehuda Sadeh
c0b537063d rgw: check_disk_state also updates other object metadata
When we do a check_disk_state() on an object that is not complete,
we need to also update etag, content_type, owner, and display_name.
Otherwise, we'd end up missing that from the bucket index. In
practice this only affects swift, as only there we're actually
looking at that info (when listing a container).

Fixes: #3234
Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:42:20 -07:00
Yehuda Sadeh
7ebab4a005 Merge branch 'wip-rgw-coverity2' 2012-10-08 15:23:08 -07:00
Yehuda Sadeh
acb3053904 rgw: set null termination explicitly
Make sure that string is null terminated.
Fixes coverity issue.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:15:08 -07:00
Yehuda Sadeh
8731d0d155 cls_rgw: return returned ret code
Wasn't setting the ret code. A coverity issue.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:15:04 -07:00
Yehuda Sadeh
58ad3bf3be rgw: add missing parantheses
.. around logic operations at process_intent_log().
Another coverity fix.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:14:57 -07:00
Yehuda Sadeh
b13a36c0d4 rgw: check NULL before dereference
Another coverity fix.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:12:52 -07:00
Yehuda Sadeh
148ba6e5bf rgw-admin: pass object by reference
Large object should be passed by reference (coverity fix).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:12:48 -07:00
Yehuda Sadeh
091bf4550e rgw: fix leaks in certain error paths
Fixes a few coverity issues

Conflicts:
	src/rgw/rgw_rados.cc

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:12:40 -07:00
Yehuda Sadeh
ce94875173 rgw: fix (im)possible leak
Fixes coverity issue

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:11:19 -07:00
Yehuda Sadeh
79b15a2658 rgw: catch possible exception
Fix coverity issue 717168.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:11:16 -07:00
Yehuda Sadeh
5dbda139d2 rgw: initialize member variables at req_state
Fixes more coverity issues

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:11:12 -07:00
Yehuda Sadeh
5a615f18d1 rgw: initialize data members
Fixes a few coverity issues.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:11:07 -07:00
Yehuda Sadeh
ddb1bb0d5b rgw: RGWObjState() initialize memebers
Initialize members at constructor. Fixes coverity issues.

Conflicts:
	src/rgw/rgw_rados.h

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:10:59 -07:00
Yehuda Sadeh
7eb366c73b rgw: initialize members at RGWRados()
fixes coverity issues

Conflicts:
	src/rgw/rgw_rados.h

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:09:15 -07:00
Yehuda Sadeh
d16e25f417 cls_rgw: check pointer before dereferencing
Fixes coverity issue 719577

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:08:09 -07:00
Yehuda Sadeh
7ab3d2a276 rgw: multiple coverity fixes of uninitialized fields
Fields were not initialized explicitly by constractor.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:08:05 -07:00
Yehuda Sadeh
b5ed23d13c rgw: trivial fix
fix coverity issue 728052

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:08:01 -07:00
Yehuda Sadeh
e042d6be1e rgw: change size_t to ssize_t for string.rfind() result
fixes coverity bug 728053

string.rfind() may return negative value, switch to ssize_t instead
of size_t.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:07:57 -07:00
Yehuda Sadeh
d2159bf0b7 rgw: fix resource leak
coverity bug 728055

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 15:07:48 -07:00
Dan Mick
e233dffa65 Revert "admin/build-doc: Use installed Sphinx and its dependencies, when possible."
This reverts commit c65ffe9f7f.

oneiric, where the doc gitbuilder runs, doesn't have the
--system-site-packages option; let's get docs back and sort this out
offline.  (virtualenv 1.6.4-0ubuntu1 on oneiric, 1.7.1.2-1 on precise)
2012-10-08 15:00:30 -07:00
Yehuda Sadeh
a780d47fbb Merge branch 'wip-admin-rest'
Conflicts:
	doc/radosgw/index.rst
	src/rgw/rgw_admin.cc
	src/rgw/rgw_main.cc
	src/rgw/rgw_op.cc
	src/rgw/rgw_op.h
	src/rgw/rgw_rest.cc
	src/rgw/rgw_rest.h
	src/rgw/rgw_rest_s3.cc
	src/rgw/rgw_rest_s3.h
	src/rgw/rgw_rest_swift.cc
	src/rgw/rgw_rest_swift.h
	src/rgw/rgw_swift_auth.cc
	src/rgw/rgw_swift_auth.h

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 14:30:17 -07:00
Yehuda Sadeh
3091b5f55a rgw: virtual bucket affects resource lookup
Removed special casing of virtual bucket handling
and just prepending it to the URI. So now virtual
bucket also affects admin and swift* protocols.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:27:05 -07:00
Yehuda Sadeh
0344c6b167 rgw: document admin, usage api
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:27:02 -07:00
Yehuda Sadeh
cb1fdb9e41 rgw: fix chunked object PUT for small objects
We didn't update buffer size according to read data.
Also, didn't update the total obj_size (was doing it only
for the second chunk being put, but for chunked input that
only had a single piece we ended up with zero obj_size). Also
remove assertion that second call to handle_data() means that
ofs > chunk size. This isn't true for chunked input.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:25:00 -07:00
Yehuda Sadeh
3d1dee2b97 rgw: abort_early should initialize formatter if needed
The formatter might not have been initialized, as we
abort early (e.g., when protocol handler wasn't found)
so we need to initialize it in order to dump error
status.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:25:00 -07:00
Yehuda Sadeh
511e639e91 rgw: configurable set of enabled apis
We can now specify which set of apis the gateway supports. Also,
passed resource should not start with a slash, we prepend that
automatically.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:25:00 -07:00
Yehuda Sadeh
d22aa6c91d rgw: add user caps
User info now holds caps map, which contains a mapping between
a freestyle cap name string to permissions bitfield (read, write).

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:24:57 -07:00
Yehuda Sadeh
d8223fa50e rgw: usage trim
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:20:18 -07:00
Yehuda Sadeh
ed04755ae4 rgw: usage show accepts more params
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:20:12 -07:00
Yehuda Sadeh
42d873e9f5 rgw: different formatters for different services
Use json formatter by default for new usage stuff. Also
make it configurable.

We use the JSON formatter for the swift auth.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:12:28 -07:00