Commit Graph

21745 Commits

Author SHA1 Message Date
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
Yehuda Sadeh
2b6a27d3c1 rgw: add a flusher to handle output data, simplify client api
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:12:24 -07:00
Yehuda Sadeh
cecd7afa4f Formatter: fix XML formatter
XML formatter wasn't clearing stream string buffer
when completing the section.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:06:17 -07:00
Yehuda Sadeh
02f7870548 rgw: add rest-usage handler
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:06:17 -07:00
Yehuda Sadeh
fca6d3b992 rgw: REST resources init uses configurables
Also, move it to main().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:06:17 -07:00
Yehuda Sadeh
cea28f8cfb rgw: refactor protocol stacking
New RESTMgr* classes to handle a specific uri entry
point. Actions are handled by RGWHandler*.

Changing init order, newly instantiated RGWHandler
for every op.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 11:06:12 -07:00
Yehuda Sadeh
85f137d2a1 rgw: tie callbacks in different handlers directly to REST
Don't translate RESTful operations into a more meaningful
callback name. The handlers themselves should do that
translation. This way we can later register different
handlers with different meanings for the operations.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 10:57:48 -07:00
Yehuda Sadeh
b71b8b09e1 rgw: sed 's/_REST/_ObjStore/g' *
It's all REST, we want to add new non objstore handling,
so let's differentiate by the actual type.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 10:57:48 -07:00
Yehuda Sadeh
e153bceef2 rgw: start moving usage management functions
Move usage management functionality to its own place.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 10:57:48 -07:00
Yehuda Sadeh
a9c9f96ba5 rgw: hide fcgi details from client code
client code (rgw_rest* et al) does not need to see the
fcgi library details.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-10-08 10:57:43 -07:00
John Wilkins
c038c3f653 doc: Added admonishments to use separate host for clients.
fixes: 3264

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-10-08 10:48:27 -07:00
Sam Lang
fa66eaa162 mds: Reset session stale timer at end of open
The mds gets an open session request and immediately sets the session
stale timer.  If logging the session and sending the reply takes longer
than the timer, the client sees a stale session message before getting
the open session reply.  This fix resets the session stale timer on
completion of the mds logging operation to reduce the likelihood of
the session getting marked stale before the client can receive the
open session reply and start sending renewcaps messages.

We reset the session timer for renewcaps and force_open_sessions right
before returning the SESSION_OPEN reply to the client.  This avoids stale
sessions in the cases where the mds is highly loaded and the session_open
reply back to the client is delayed.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-08 10:58:07 -05:00
Josh Durgin
c8721b956c Merge branch 'wip-osd-caps'
Conflicts:
	src/osd/OSDCap.cc
	src/test/osd/osdcap.cc

Reviewed-by: Sage Weil <sage.weil@inktank.com>
2012-10-05 16:21:12 -07:00
Tommi Virtanen
48fc340ce8 upstart: OSD journal can be a symlink; if it's dangling, don't start.
This lets a $osd_data/journal symlink point to
/dev/disk/by-partuuid/UUID and the osd will not attempt to start until
that disk is available.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
2012-10-05 15:41:35 -07:00
Sage Weil
8d718caf00 osd: Make --get-journal-fsid not really start the osd.
This way, it won't need -i ID and it won't access the osd_data_dir.
That makes it useful for locating the right osd to use with an
external journal partition.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
2012-10-05 15:41:35 -07:00
Tommi Virtanen
435a5c1435 osd: Make --get-journal-fsid not attempt aio or direct_io.
Signed-off-by: Tommi Virtanen <tv@inktank.com>
2012-10-05 15:41:35 -07:00