]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agoosdc/ObjectCacher: fill in zero buffers in map_read() on miss if complete
Sage Weil [Wed, 24 Oct 2012 21:42:50 +0000 (14:42 -0700)]
osdc/ObjectCacher: fill in zero buffers in map_read() on miss if complete

If we know we have the complete object in cache, fill in zero buffers
when we miss.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: improve debug output for readx()
Sage Weil [Wed, 24 Oct 2012 21:43:03 +0000 (14:43 -0700)]
osdc/ObjectCacher: improve debug output for readx()

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: set complete flag when we observe ENOENT
Sage Weil [Wed, 24 Oct 2012 21:41:38 +0000 (14:41 -0700)]
osdc/ObjectCacher: set complete flag when we observe ENOENT

If we observe an ENOENT on a read, set the complete flag.  Any dirty
buffers we have will still be in memory, even if the write are in flight,
because the TX state remains pinned until the writes commit.  Writes cannot
proceed faster than reads, even though reads may proceed faster than
writes.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: clear complete on trim, release
Sage Weil [Wed, 24 Oct 2012 21:36:05 +0000 (14:36 -0700)]
osdc/ObjectCacher: clear complete on trim, release

Clear the complete flag when we are discarding buffers.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: add complete flag
Sage Weil [Wed, 24 Oct 2012 21:35:24 +0000 (14:35 -0700)]
osdc/ObjectCacher: add complete flag

This is set when we know we have *all* the data for this object.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: refresh iterator in read apply loop
Sage Weil [Wed, 24 Oct 2012 19:48:02 +0000 (12:48 -0700)]
osdc/ObjectCacher: refresh iterator in read apply loop

The p iterator points to the next bh, but try_merge_bh() at the end of the
loop might merge that into our result and invalidate the iterator.  Fix
this by repeating the lookup on each pass through the loop.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: do read completions after assimilating read result
Sage Weil [Wed, 24 Oct 2012 19:44:25 +0000 (12:44 -0700)]
osdc/ObjectCacher: do read completions after assimilating read result

Wait until we have applied the entire read result to the cache before we
trigger any read completion events.  This is a cleaner and safer approach
since we can be sure that the callback won't get blocked again on data we
have but haven't applied yet.  It also fixes a crash I just observed where
the completion did a read, called trim(), and invalidated/destroyed the
iterator/bh p was referencing.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: do not close objects explicitly
Sage Weil [Tue, 23 Oct 2012 16:20:53 +0000 (09:20 -0700)]
osdc/ObjectCacher: do not close objects explicitly

Let the trimmer do that.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: make trim() trim Objects
Sage Weil [Tue, 23 Oct 2012 16:20:35 +0000 (09:20 -0700)]
osdc/ObjectCacher: make trim() trim Objects

Pull unpinned objects off the LRU in trim().  This never happens currently
due to all the explicit calls to close_object()...

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: check lru_is_expireable() in can_close()
Sage Weil [Tue, 23 Oct 2012 16:18:04 +0000 (09:18 -0700)]
osdc/ObjectCacher: check lru_is_expireable() in can_close()

We assert that if can_close(), the Object isn't pinned in the LRU.  This
assumes we did yur get/put refcounting properly, such that the pins are
at least as restrictive as can_close().

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: add LRU for Object
Sage Weil [Tue, 23 Oct 2012 12:58:27 +0000 (05:58 -0700)]
osdc/ObjectCacher: add LRU for Object

Incomplete; we aren't trimming yet.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: take Object ref for bh writes
Sage Weil [Tue, 23 Oct 2012 13:04:08 +0000 (06:04 -0700)]
osdc/ObjectCacher: take Object ref for bh writes

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: take refs for inflight lock ops
Sage Weil [Tue, 23 Oct 2012 13:03:09 +0000 (06:03 -0700)]
osdc/ObjectCacher: take refs for inflight lock ops

These are all dead/unused; should probably just rip out this code!

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: take Object ref when there are buffers
Sage Weil [Tue, 23 Oct 2012 12:55:50 +0000 (05:55 -0700)]
osdc/ObjectCacher: take Object ref when there are buffers

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: add ref count to Object
Sage Weil [Tue, 23 Oct 2012 12:55:23 +0000 (05:55 -0700)]
osdc/ObjectCacher: add ref count to Object

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdc/ObjectCacher: rename lru_* -> bh_lru_*
Sage Weil [Tue, 23 Oct 2012 12:42:37 +0000 (05:42 -0700)]
osdc/ObjectCacher: rename lru_* -> bh_lru_*

We'll be adding LRUs for objects, too.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: fix race in AioCompletion that are still being built
Sage Weil [Fri, 26 Oct 2012 18:30:06 +0000 (11:30 -0700)]
librbd: fix race in AioCompletion that are still being built

When caching is enabled, it is possible for the io completion to happen
faster than we call ->finish_adding_requests() (e.g., on cache read).
When that happens, the final read request completion doesn't see a
pending_count == 0 and thus doesn't do all the final buffer construction
that is necessary to return correct data.  In particular, users will see
zeroed buffers.  test_librbd_fsx is turning this up consistently after
several thousand ops with an image size of ~100MB and cloning disabled.

This was introduced with the extra logic added here with striping.

Fix this by making a separate flag to indicate the completion is under
construction, and make sure we call complete() when both pending_count==0
and building==false.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMerge branch 'wip-client-unmount'
Noah Watkins [Fri, 26 Oct 2012 16:07:19 +0000 (09:07 -0700)]
Merge branch 'wip-client-unmount'

Signed-off-by: Noah Watkins <noah.watkins@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoclient: add ceph_release, ceph_shutdown
Noah Watkins [Thu, 25 Oct 2012 20:00:05 +0000 (13:00 -0700)]
client: add ceph_release, ceph_shutdown

Notes that ceph_shutdown() is now deprecated.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoclient: double mount returns -EISCONN
Noah Watkins [Thu, 25 Oct 2012 19:04:00 +0000 (12:04 -0700)]
client: double mount returns -EISCONN

Change error code from -EDOM to -EISCONN when mounting an already
mounted ceph_mount_info instance.  The current convention is to return
-ENOTCONN when using the libcephfs interface in an unmounted state.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoMerge branch 'wip-mds'
Sage Weil [Fri, 26 Oct 2012 03:49:25 +0000 (20:49 -0700)]
Merge branch 'wip-mds'

Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoclient: do not reset session state on reopened sessions
Sage Weil [Sun, 21 Oct 2012 21:54:23 +0000 (14:54 -0700)]
client: do not reset session state on reopened sessions

We can have a sequence one the MDS like:

 - queue REQUEST_CLOSE to journal
 - force_open, queue open to journal
 - request_close acked, do nothing
 - force_open acked, send OPEN

In this case, the MDS never actually closed the session, and all of the
state remained valid.  The client, however, gets a suprious OPEN
message and resets the session state.

Fix this by not resetting that state.

A nicer fix might be to not send the second OPEN at all, but that would
require a REOPENING state on the MDS which is more complicated; this is
good enough.  Also, that approach might not give the client an
appropriate opportunity to say "um, no..." and resend the
REQUEST_CLOSE.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix handling of cache_expire export
Sage Weil [Sun, 21 Oct 2012 21:22:51 +0000 (14:22 -0700)]
mds: fix handling of cache_expire export

During export, between the warning stage and the final notify, we may
get cache expire messages because the replicas are sending to both us
and the new auth.  This check should look for >= WARNING so that it
includes the EXPORTING states as well as the portion of WARNING after
we heard from that replica.  This aligns the conditional with the
following assert such that they are properly mutually exclusive.

Fixes: #1527
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: do not mark closed connections disposable
Sage Weil [Sun, 21 Oct 2012 20:50:05 +0000 (13:50 -0700)]
mds: do not mark closed connections disposable

These will get reused when the client reconnects.  If we are going to
clean these up, we need a different strategy.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: use connection on closed sessions in force_open_sessions
Sage Weil [Sun, 21 Oct 2012 16:58:44 +0000 (09:58 -0700)]
mds: use connection on closed sessions in force_open_sessions

If the have a Connection*, use it.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: update copyright to include contributors, CC
Ross Turk [Fri, 26 Oct 2012 00:51:04 +0000 (17:51 -0700)]
doc: update copyright to include contributors, CC

Signed-off-by: Ross Turk <ross@inktank.com>
12 years agoMerge branch 'next'
Sage Weil [Thu, 25 Oct 2012 19:00:02 +0000 (12:00 -0700)]
Merge branch 'next'

12 years agoosd: fix populate_obc_watchers() assert
Sage Weil [Thu, 25 Oct 2012 00:00:01 +0000 (17:00 -0700)]
osd: fix populate_obc_watchers() assert

There is one case where populate_obc_watchers gets called when the object
is missing: during a revert.  And in that case we *should* do the populate,
since all that is getting reverted is the object version.

Fixes: #3405
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Sam Just <sam.just@inktank.com>
12 years agomds: check getcwd() return value
Sage Weil [Thu, 25 Oct 2012 04:34:42 +0000 (21:34 -0700)]
mds: check getcwd() return value

warning: mds/MDS.cc:1586:27: ignoring return value of ‘char* getcwd(char*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoleveldb: fix accidental submodule revert
Sage Weil [Thu, 25 Oct 2012 00:04:42 +0000 (17:04 -0700)]
leveldb: fix accidental submodule revert

a5eb72ba01bc74886170f2f6b97278ba5fc251d1

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: note raw format required for openstack/rbd
Josh Durgin [Wed, 24 Oct 2012 23:19:21 +0000 (16:19 -0700)]
doc: note raw format required for openstack/rbd

A couple people have been confused by this omission.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agomds: fix #include for getcwd(), simplify
Sage Weil [Wed, 24 Oct 2012 16:38:58 +0000 (09:38 -0700)]
mds: fix #include for getcwd(), simplify

Always use getcwd().. it's more portable.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: Added hyperlink.
John Wilkins [Wed, 24 Oct 2012 16:27:34 +0000 (09:27 -0700)]
doc: Added hyperlink.

fixes: #3393

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Fixed usage and deleted legacy values.
John Wilkins [Wed, 24 Oct 2012 16:14:12 +0000 (09:14 -0700)]
doc: Fixed usage and deleted legacy values.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agovstart.sh: Use ./init-ceph instead of CEPH_BIN
Sam Lang [Tue, 23 Oct 2012 21:21:02 +0000 (16:21 -0500)]
vstart.sh:  Use ./init-ceph instead of CEPH_BIN

This effectively reverts faddb80c4230acad2b4a17aa6cbf0c30ae8d24a9
which prevented vstart.sh from being used in an enviroment where
CEPH_BIN pointed to a make install target.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoScript that generates perl wrapper for teuthology tests
tamil [Tue, 23 Oct 2012 20:08:20 +0000 (13:08 -0700)]
Script that generates perl wrapper for teuthology tests

Signed-off-by: tamil <tamil.muthamizhan@inktank.com>
12 years agorgw_admin: do not throw error when start-date and end-date are not
caleb miles [Tue, 23 Oct 2012 17:36:53 +0000 (13:36 -0400)]
rgw_admin: do not throw error when start-date and end-date are not
passed to usage::trim()

Signed-off-by: caleb miles <caleb.miles@inktank.com>
12 years agoMerge branch 'wip-assert-exists-2'
Sage Weil [Tue, 23 Oct 2012 12:37:54 +0000 (05:37 -0700)]
Merge branch 'wip-assert-exists-2'

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoosd/osd_types: make stat osd_op print nicely
Sage Weil [Tue, 23 Oct 2012 00:57:32 +0000 (17:57 -0700)]
osd/osd_types: make stat osd_op print nicely

No 0~0 crap.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: use assert_exists() to simplify copyup check
Sage Weil [Tue, 23 Oct 2012 00:57:08 +0000 (17:57 -0700)]
librbd: use assert_exists() to simplify copyup check

Previously we would explicitly STAT the object to see if it exists before
sending the write to the OSD.  Instead, send the write optimistically, and
assert that the object already exists.  This avoids an extra round trip in
the optimistic/common case, and makes the existence check in the initial
first-write case more expensive because we send the data payload along.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrados: add assert_exists guard operation
Sage Weil [Tue, 23 Oct 2012 00:51:11 +0000 (17:51 -0700)]
librados: add assert_exists guard operation

Add a guard operation for writes that asserts that the object already
exists.  To avoid requiring new functionality on the OSD side, implement
this by including a STAT operation, and discard the results on the
client side.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: validate copy size against proper snapshot id
Dan Mick [Tue, 23 Oct 2012 03:31:33 +0000 (20:31 -0700)]
librbd: validate copy size against proper snapshot id

Fixes: #3383
Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoosd: return EOPNOTSUPP on bad class or method name
Sage Weil [Tue, 23 Oct 2012 00:30:37 +0000 (17:30 -0700)]
osd: return EOPNOTSUPP on bad class or method name

Currently we return EIO, which isn't particularly informative.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoleveldb: fix accidental revert
Sage Weil [Tue, 23 Oct 2012 00:25:03 +0000 (17:25 -0700)]
leveldb: fix accidental revert

In b85cde576e3444b10c275526ecf43b73bd21afe5

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: dump an error message if FCGX_Accept fails
Yehuda Sadeh [Mon, 22 Oct 2012 23:52:11 +0000 (16:52 -0700)]
rgw: dump an error message if FCGX_Accept fails

Adding missing debug info.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoworkqueue: make debug output include active threads
Sage Weil [Mon, 22 Oct 2012 22:38:30 +0000 (15:38 -0700)]
workqueue: make debug output include active threads

Include active thread count in threadpool debug output.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'wip-msgr'
Sage Weil [Mon, 22 Oct 2012 21:47:24 +0000 (14:47 -0700)]
Merge branch 'wip-msgr'

12 years agomsg/Pipe: fix tight reconnect loop on connect failure
Sage Weil [Mon, 22 Oct 2012 21:14:09 +0000 (14:14 -0700)]
msg/Pipe: fix tight reconnect loop on connect failure

The fault() call in connect should not set onread=true since connect is
effectively a write path.  This was forcing the writer() into a tight
loop that repeatedly would call connect(); not very polite.

Changing that, we want to avoid treating this as a normal fault (with the
failure callback) and instead back off.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agothrottle: less default log noise
Sage Weil [Mon, 22 Oct 2012 21:41:35 +0000 (14:41 -0700)]
throttle: less default log noise

This tends to drown out anything interesting in the log buffer.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: document defaults for rbd bench-write
Dan Mick [Mon, 22 Oct 2012 20:32:25 +0000 (13:32 -0700)]
rbd: document defaults for rbd bench-write

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agotest: Dont check initial permissions
Sam Lang [Mon, 22 Oct 2012 20:24:09 +0000 (15:24 -0500)]
test: Dont check initial permissions

We can't check the initial permissions of the
file because the umask may be set to something
other than 0022.  The check isn't needed to check
for chmod correctness anyway.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMakefile: include java in dist tarball
Sage Weil [Mon, 22 Oct 2012 19:51:00 +0000 (12:51 -0700)]
Makefile: include java in dist tarball

Include all the java goodness in the dist tarball.  Fixes package builds.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorgw: check client write status on swift get_obj
Yehuda Sadeh [Mon, 22 Oct 2012 19:41:30 +0000 (12:41 -0700)]
rgw: check client write status on swift get_obj

Fixes: #3381
We check the return code of the cio->write() operation
when doing get_obj(). This makes sure that we don't
continue processing the request if client has disconnected.
This commit complements another commit that does the same
for the specific s3 operation.

backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agorgw: don't continue processing of GET request on error
Yehuda Sadeh [Mon, 22 Oct 2012 18:00:08 +0000 (11:00 -0700)]
rgw: don't continue processing of GET request on error

Fixes #3381
We continued processing requests long after the client has died.

backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Mon, 22 Oct 2012 17:46:04 +0000 (10:46 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agoosd: drop conditional check in populate_obc_watchers
Sage Weil [Mon, 22 Oct 2012 17:45:36 +0000 (10:45 -0700)]
osd: drop conditional check in populate_obc_watchers

Turn these into asserts.  The only two callers are create_object_context()
and get_object_context(), and they only get called when the object is no
longer missing.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoosd: populate obc watchers even when degraded
Sage Weil [Mon, 22 Oct 2012 17:45:20 +0000 (10:45 -0700)]
osd: populate obc watchers even when degraded

Bug #3142 appears to be caused by the following sequence:

 - object X missing on primary and replica
 - [assert-ver,watch], notify, unwatch requests come in, get deferred
 - object is recovered on primary, !missing, create_object_context
   - populate_obc_watchers() does nothing, since still degraded
 - notify happens now (odd but ok?)
 - replica recovered, !degraded
 - watch skips bc of bad assert
 - unwatch trips up on an assert because populate_obc_watchers never
   ran

Fix this by populating the obc watcher when !missing, not when
!degraded.  This conditional dates back to Sam's original watch/notify
cleanup in October 2011.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agorun-cli-tests: Include rationale for cram patch and pointer to issue.
Tommi Virtanen [Mon, 22 Oct 2012 17:40:39 +0000 (10:40 -0700)]
run-cli-tests: Include rationale for cram patch and pointer to issue.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agodoc: Changed rack, row text to row, rack. Fixed some syntax. Added note.
John Wilkins [Mon, 22 Oct 2012 17:15:03 +0000 (10:15 -0700)]
doc: Changed rack, row text to row, rack. Fixed some syntax. Added note.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agovstart.sh: cephx on by default, -X to disable
Joe Buck [Mon, 22 Oct 2012 15:32:32 +0000 (08:32 -0700)]
vstart.sh: cephx on by default, -X to disable

Signed-off-by: Joe Buck <jbbuck@gmail.com>
12 years agoobjecter: move map checks to helper
Sage Weil [Mon, 22 Oct 2012 04:07:12 +0000 (21:07 -0700)]
objecter: move map checks to helper

This makes coverity happier because we check_op_pool_dne() may free
the Op (or Lingerop) structure(s), but the callers in the submit_*
paths dereference after calling.  This is actually safe because they
never free new ops, but is confusing.  Explicitly push this into a
separate helper.

CID 739607 (#1-2 of 2): Read from pointer after free (USE_AFTER_FREE)
At (9): Dereferencing freed pointer "o".

CID 739606 (#1 of 1): Read from pointer after free (USE_AFTER_FREE)
At (28): Dereferencing freed pointer "op".

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-mds-coverity'
Sage Weil [Mon, 22 Oct 2012 03:58:19 +0000 (20:58 -0700)]
Merge remote-tracking branch 'gh/wip-mds-coverity'

12 years agomds: avoid copy in SessionMap::get_or_add_session()
Sage Weil [Mon, 22 Oct 2012 03:57:14 +0000 (20:57 -0700)]
mds: avoid copy in SessionMap::get_or_add_session()

CID 717032 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
Passing parameter i of type entity_inst_t (size 152 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: init layout in ImageCtx ctor
Sage Weil [Mon, 22 Oct 2012 03:56:25 +0000 (20:56 -0700)]
librbd: init layout in ImageCtx ctor

At (6): Non-static class member field "layout.fl_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (8): Non-static class member field "layout.fl_stripe_count" is not initialized in this constructor nor in any functions that it calls.
At (10): Non-static class member field "layout.fl_object_size" is not initialized in this constructor nor in any functions that it calls.
At (12): Non-static class member field "layout.fl_cas_hash" is not initialized in this constructor nor in any functions that it calls.
At (14): Non-static class member field "layout.fl_object_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (16): Non-static class member field "layout.fl_unused" is not initialized in this constructor nor in any functions that it calls.
CID 717224 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (18): Non-static class member field "layout.fl_pg_pool" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: init vars in AioRequest ctor
Sage Weil [Mon, 22 Oct 2012 03:55:41 +0000 (20:55 -0700)]
librbd: init vars in AioRequest ctor

At (2): Non-static class member "m_object_no" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "m_object_off" is not initialized in this constructor nor in any functions that it calls.
CID 717222 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (6): Non-static class member "m_object_len" is not initialized in this constructor nor in any functions that it calls.

CID 717223 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "m_parent_overlap" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: pass by ref
Sage Weil [Sun, 21 Oct 2012 22:31:17 +0000 (15:31 -0700)]
mon: pass by ref

CID 717044: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter to of type entity_inst_t (size 152 bytes) by value.

CID 717045: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter a of type entity_addr_t (size 136 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomonmap: pass by ref
Sage Weil [Sun, 21 Oct 2012 22:29:23 +0000 (15:29 -0700)]
monmap: pass by ref

CID 717039 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
Passing parameter my_addr of type entity_addr_t (size 136 bytes) by value.

CID 717040: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter a of type entity_addr_t (size 136 bytes) by value.

CID 717041: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter a of type entity_addr_t (size 136 bytes) by value.

CID 717043: Big parameter passed by value (PASS_BY_VALUE)
Passing parameter a of type entity_addr_t (size 136 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: release import caps we don't have
Sage Weil [Wed, 17 Oct 2012 22:44:09 +0000 (15:44 -0700)]
client: release import caps we don't have

If we don't have the inode, release the caps.  There is no point in adding
it to our cache, and that is problematic anyway because it ends up with a
ref count of zero and no dentry that will get trimmed by trim_cache(),
leaving it stuck there on shutdown.

This also aligns us with the kernel client behavior.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoauth: change default: require 'cephx' for daemons
Sage Weil [Wed, 12 Sep 2012 00:20:28 +0000 (17:20 -0700)]
auth: change default: require 'cephx' for daemons

Daemons will require cephx.

Clients will require nothing (i.e., will be able to connect to a cluster
with auth disabled).

See #3136

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'wip-testrados'
Sage Weil [Sun, 21 Oct 2012 16:01:33 +0000 (09:01 -0700)]
Merge branch 'wip-testrados'

Lightly-reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agomds: fix typo, build
Sage Weil [Sun, 21 Oct 2012 15:52:54 +0000 (08:52 -0700)]
mds: fix typo, build

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: make dup session close an error; make case consistent
Sage Weil [Sun, 21 Oct 2012 01:46:03 +0000 (18:46 -0700)]
mds: make dup session close an error; make case consistent

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: deal with the case where you have a Session close event without a Session.
Greg Farnum [Fri, 19 Oct 2012 21:27:38 +0000 (14:27 -0700)]
mds: deal with the case where you have a Session close event without a Session.

This case shouldn't ever happen, but we've seen it, so there's a bug
somewhere. Handling a Session close when the Session is already closed
is easy, though -- we don't need to do anything!

Signed-off-by: Greg Farnum <greg@inktank.com>
12 years agodoc: Added clarification from Peter's feedback.
John Wilkins [Fri, 19 Oct 2012 22:40:33 +0000 (15:40 -0700)]
doc: Added clarification from Peter's feedback.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Added backward compatibility text. Additional cleanup.
John Wilkins [Fri, 19 Oct 2012 22:40:03 +0000 (15:40 -0700)]
doc: Added backward compatibility text. Additional cleanup.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoman: update ceph-debugpack, ceph man pages
Sage Weil [Fri, 19 Oct 2012 17:42:48 +0000 (10:42 -0700)]
man: update ceph-debugpack, ceph man pages

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: update man page build
Sage Weil [Fri, 19 Oct 2012 17:41:51 +0000 (10:41 -0700)]
rbd: update man page build

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: clean up doc build directions
Sage Weil [Fri, 19 Oct 2012 17:40:25 +0000 (10:40 -0700)]
doc: clean up doc build directions

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'noah/wip-java-cephfs'
Sage Weil [Fri, 19 Oct 2012 17:32:37 +0000 (10:32 -0700)]
Merge remote-tracking branch 'noah/wip-java-cephfs'

12 years agojava: update deb bits from ceph-devel feedback
Noah Watkins [Wed, 10 Oct 2012 20:57:03 +0000 (13:57 -0700)]
java: update deb bits from ceph-devel feedback

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agojava: add test for mount with bad root
Noah Watkins [Thu, 6 Sep 2012 17:41:51 +0000 (10:41 -0700)]
java: add test for mount with bad root

This adds a unit test that verifies that mounting Ceph with a
non-existent root directory throws FileNotFoundException.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoMakefile: add src/include to #include path for libcephfs_jni_la
Sage Weil [Sat, 1 Sep 2012 17:26:41 +0000 (10:26 -0700)]
Makefile: add src/include to #include path for libcephfs_jni_la

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agodo_autogen.sh: add -j flag to enable java stuff
Sage Weil [Sat, 1 Sep 2012 17:26:41 +0000 (10:26 -0700)]
do_autogen.sh: add -j flag to enable java stuff

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agodebian: add libcephfs-java package
Noah Watkins [Sat, 1 Sep 2012 17:26:41 +0000 (10:26 -0700)]
debian: add libcephfs-java package

Creates libceph1-java package that contains
the libcephfs Java wrappers .jar file and the
JNI library.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agoautomake: setup autotools to build cephfs-java
Noah Watkins [Sat, 1 Sep 2012 17:26:41 +0000 (10:26 -0700)]
automake: setup autotools to build cephfs-java

Adds --enable-cephfs-java and --with-jdk to build
the libcephfs Java bindings and specify the default
JDK directory, respectively.

Also adds default JDK paths to avoid --with-jdk in
the common case. Currently setup for the default
provided by Debian's default-jdk package, but other
default search paths can easily be added.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agojava: add Java and C++ source files
Noah Watkins [Sat, 1 Sep 2012 17:26:41 +0000 (10:26 -0700)]
java: add Java and C++ source files

This adds all of the Java and C++ source files that make up the
libcephfs Java wrappers package.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agolibcephfs: return error when not mounted
Noah Watkins [Sat, 1 Sep 2012 17:26:41 +0000 (10:26 -0700)]
libcephfs: return error when not mounted

Return an error rather than a segfault if a client uses the interface
when unmounted.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
12 years agotest/libcephfs: Fix telldir/seekdir test
Sam Lang [Wed, 17 Oct 2012 17:45:20 +0000 (12:45 -0500)]
test/libcephfs: Fix telldir/seekdir test

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomds: use const ref instead of large pass-by-value
Sage Weil [Fri, 19 Oct 2012 16:11:55 +0000 (09:11 -0700)]
mds: use const ref instead of large pass-by-value

CID 717033 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
Passing parameter inst of type entity_inst_t (size 152 bytes) by value.

CID 717034 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
Passing parameter inst of type entity_inst_t (size 152 bytes) by value.

CID 717032 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
Passing parameter i of type entity_inst_t (size 152 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: annotate switch case fall-thru
Sage Weil [Fri, 19 Oct 2012 16:10:31 +0000 (09:10 -0700)]
mds: annotate switch case fall-thru

CID 716960 (#1 of 1): Missing break in switch (MISSING_BREAK)
This case (value 1) is not terminated by a 'break' statement.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix coverity warnings on NULL deref
Sage Weil [Fri, 19 Oct 2012 16:09:53 +0000 (09:09 -0700)]
mds: fix coverity warnings on NULL deref

Add asserts...

At (5): Function "MDCache::get_dirfrag(dirfrag_t)" returns null (checked 33 out of 39 times). [show details]
At (6): Assigning: "dir" = null return value from "MDCache::get_dirfrag(dirfrag_t)".
CID 717007 (#1 of 1): Dereference null return value (NULL_RETURNS)
At (7): Dereferencing a pointer that might be null "dir" when calling "MDCache::adjust_bounded_subtree_auth(CDir *, std::vector<dirfrag_t, std::allocator<dirfrag_t> > &, std::pair<int, int>)". [show details]

CID 717006 (#1 of 1): Dereference null return value (NULL_RETURNS)
At (5): Dereferencing a pointer that might be null "dir" when calling "MDCache::adjust_bounded_subtree_auth(CDir *, std::vector<dirfrag_t, std::allocator<dirfrag_t> > &, std::pair<int, int>)". [show details]

CID 717005 (#2 of 2): Dereference null return value (NULL_RETURNS)
At (22): Dereferencing a pointer that might be null "dir" when calling "MDCache::adjust_bounded_subtree_auth(CDir *, std::vector<dirfrag_t, std::allocator<dirfrag_t> > &, int)". [show details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix possible inode_t::get_layout_size_increment() overflow
Sage Weil [Fri, 19 Oct 2012 16:07:31 +0000 (09:07 -0700)]
mds: fix possible inode_t::get_layout_size_increment() overflow

CID 717015 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
Potentially overflowing expression "this->layout.fl_object_size.operator unsigned int() * this->layout.fl_stripe_count.operator unsigned int()" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic before being used in a context which expects an expression of type "uint64_t" (64 bits, unsigned). To avoid overflow, cast either operand to "uint64_t" before performing the multiplication.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: init cap_reconnect_t::flock_len
Sage Weil [Fri, 19 Oct 2012 16:06:39 +0000 (09:06 -0700)]
mds: init cap_reconnect_t::flock_len

CID 717256 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member field "capinfo.flock_len" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: init in cap_reconnect_t ctor
Sage Weil [Fri, 19 Oct 2012 16:06:06 +0000 (09:06 -0700)]
mds: init in cap_reconnect_t ctor

At (2): Non-static class member field "capinfo.cap_id" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member field "capinfo.wanted" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member field "capinfo.issued" is not initialized in this constructor nor in any functions that it calls.
At (8): Non-static class member field "capinfo.snaprealm" is not initialized in this constructor nor in any functions that it calls.
At (10): Non-static class member field "capinfo.pathbase" is not initialized in this constructor nor in any functions that it calls.
CID 717257 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
At (12): Non-static class member field "capinfo.flock_len" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: init inode_t::dir_layout
Sage Weil [Fri, 19 Oct 2012 16:04:10 +0000 (09:04 -0700)]
mds: init inode_t::dir_layout

At (2): Non-static class member field "dir_layout.dl_dir_hash" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member field "dir_layout.dl_unused1" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member field "dir_layout.dl_unused2" is not initialized in this constructor nor in any functions that it calls.
CID 717258 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'wip-3346'
Sam Lang [Fri, 19 Oct 2012 03:14:24 +0000 (22:14 -0500)]
Merge branch 'wip-3346'

12 years agorbd: implement bench-write command
Sage Weil [Thu, 18 Oct 2012 23:43:26 +0000 (16:43 -0700)]
rbd: implement bench-write command

We may want to change the command line args around later to make this
more friendly.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'wip-rbd-stripe' (early part)
Sage Weil [Thu, 18 Oct 2012 23:42:15 +0000 (16:42 -0700)]
Merge branch 'wip-rbd-stripe' (early part)

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: print useful error message if striping is specified for format 1
Sage Weil [Tue, 9 Oct 2012 16:22:48 +0000 (09:22 -0700)]
rbd: print useful error message if striping is specified for format 1

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: Fix permissions checking for O_WRONLY
Sam Lang [Thu, 18 Oct 2012 20:21:10 +0000 (15:21 -0500)]
client: Fix permissions checking for O_WRONLY

O_RDONLY is 0 in glibc, so we have to assume the
flags bits are mutually exclusive, otherwise we always
request read perms and write-only modes break.

Signed-off-by: Sam Lang <sam.lang@inktank.com>