Commit Graph

22068 Commits

Author SHA1 Message Date
Sage Weil
2248822b2c 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>
2012-10-22 10:45:36 -07:00
Sage Weil
4156b984a5 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>
2012-10-22 10:45:20 -07:00
Tommi Virtanen
a13535229a run-cli-tests: Include rationale for cram patch and pointer to issue.
Signed-off-by: Tommi Virtanen <tv@inktank.com>
2012-10-22 10:41:37 -07:00
John Wilkins
a7a6850d95 doc: Changed rack, row text to row, rack. Fixed some syntax. Added note.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-10-22 10:15:03 -07:00
Joe Buck
3d0a522421 vstart.sh: cephx on by default, -X to disable
Signed-off-by: Joe Buck <jbbuck@gmail.com>
2012-10-22 08:32:32 -07:00
Sage Weil
2d20f3a8a4 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>
2012-10-21 21:07:12 -07:00
Sage Weil
aae72c259c Merge remote-tracking branch 'gh/wip-mds-coverity' 2012-10-21 20:58:19 -07:00
Sage Weil
da5b244700 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>
2012-10-21 20:57:14 -07:00
Sage Weil
7a3ccef89c 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>
2012-10-21 20:56:25 -07:00
Sage Weil
2c45d1cbdf 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>
2012-10-21 20:55:41 -07:00
Sage Weil
d2f07cc493 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>
2012-10-21 15:32:52 -07:00
Sage Weil
0fedc28dac 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>
2012-10-21 15:29:23 -07:00
Sage Weil
7d9ee17e82 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>
2012-10-21 09:26:09 -07:00
Sage Weil
66bda162e1 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>
2012-10-21 09:05:02 -07:00
Sage Weil
ddde1c8f6a Merge branch 'wip-testrados'
Lightly-reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-21 09:01:33 -07:00
Sage Weil
91a2492a9b mds: fix typo, build
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-21 08:52:54 -07:00
Sage Weil
5fb8a22c1c mds: make dup session close an error; make case consistent
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-20 18:46:03 -07:00
Greg Farnum
e6cbcb2400 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>
2012-10-20 15:58:56 -07:00
John Wilkins
5e221a4041 doc: Added clarification from Peter's feedback.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-10-19 15:40:33 -07:00
John Wilkins
3870ce2fe3 doc: Added backward compatibility text. Additional cleanup.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-10-19 15:40:03 -07:00
Sage Weil
50bb65963c man: update ceph-debugpack, ceph man pages
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-19 10:42:48 -07:00
Sage Weil
c18e17d2fe rbd: update man page build
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-19 10:41:51 -07:00
Sage Weil
69a96bb513 doc: clean up doc build directions
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-19 10:40:25 -07:00
Peter Reiher
ebcad66ede Stopped logging keys in session authentication code.
Signed-off-by: Peter Reiher <reiher@inktank.com>
2012-10-19 10:33:28 -07:00
Sage Weil
e3431b6bc6 Merge remote-tracking branch 'noah/wip-java-cephfs' 2012-10-19 10:32:37 -07:00
Noah Watkins
b3cc40a333 java: update deb bits from ceph-devel feedback
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2012-10-19 10:22:38 -07:00
Noah Watkins
ad3482b2d1 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>
2012-10-19 09:59:10 -07:00
Sage Weil
941ac2f9ab 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>
2012-10-19 09:59:10 -07:00
Sage Weil
4a0398d0ba 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>
2012-10-19 09:59:10 -07:00
Noah Watkins
9feb4afdd8 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>
2012-10-19 09:59:10 -07:00
Noah Watkins
68e01649ff 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>
2012-10-19 09:59:10 -07:00
Noah Watkins
350433530f 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>
2012-10-19 09:59:10 -07:00
Noah Watkins
d2f0f895e4 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>
2012-10-19 09:59:10 -07:00
Sam Lang
233b0bdf0b test/libcephfs: Fix telldir/seekdir test
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-19 09:22:29 -07:00
Sage Weil
cc8b9e2bc5 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>
2012-10-19 09:11:55 -07:00
Sage Weil
ae8aaa457d 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>
2012-10-19 09:10:31 -07:00
Sage Weil
667fb7258c 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>
2012-10-19 09:09:53 -07:00
Sage Weil
1e987eaff8 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>
2012-10-19 09:07:31 -07:00
Sage Weil
96ff10abe0 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>
2012-10-19 09:06:39 -07:00
Sage Weil
091d16ab13 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>
2012-10-19 09:06:06 -07:00
Sage Weil
46054ce646 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>
2012-10-19 09:04:10 -07:00
Sam Lang
0166bd06c2 Merge branch 'wip-3346' 2012-10-18 22:14:24 -05:00
Sage Weil
86b43179d2 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>
2012-10-18 16:43:26 -07:00
Sage Weil
e5e076dfa1 Merge branch 'wip-rbd-stripe' (early part)
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2012-10-18 16:42:15 -07:00
Sage Weil
04d32e7eeb rbd: print useful error message if striping is specified for format 1
Signed-off-by: Sage Weil <sage@inktank.com>
2012-10-18 16:41:17 -07:00
Sam Lang
58e920be97 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>
2012-10-18 17:16:35 -05:00
Sam Lang
352a7e268e test: Make the test filename unique to test
This fixes up the chmod test to use a unique
filename to test with, and avoid clobbering of
other tests and commonly named files.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-18 17:15:45 -05:00
Sam Lang
b19ac61a7d client: Fix permissions error on open with O_CREAT
Posix allows creating/opening a file with
open() with a mode that doesn't allow write (or read)
access but flags that request it: O_CREAT|O_WRONLY.
This means that correct permissions checking against
the mode on open() only happens if the file already exists.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-10-18 17:15:45 -05:00
tamil
0571cb798d S3 test scripts
Signed-off-by: tamil <tamil.muthamizhan@inktank.com
2012-10-18 14:52:11 -07:00
John Wilkins
f6b7b5cb27 doc: minor fix on user name for GW script.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-10-18 14:47:37 -07:00