Commit Graph

21299 Commits

Author SHA1 Message Date
Josh Durgin
cd78cd243f rbd: fix leak of dir handle in get_rbd_seq
CID 717098: Resource leak (RESOURCE_LEAK)
At (6): Variable "device_dir" going out of scope leaks the storage it
points to.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:28 -07:00
Josh Durgin
84fa74e67b rbd: fix leak of fd on error when reading an entire file
CID 717100: Resource leak (RESOURCE_LEAK)
At (6): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:28 -07:00
Josh Durgin
2d44a1a3e1 rbd: fix leak of fd when importing an image from a file
CID 719579: Resource leak (RESOURCE_LEAK)
At (7): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:28 -07:00
Josh Durgin
dd10b1e834 secret: close fd on error
CID 717079: Resource leak (RESOURCE_LEAK)
At (6): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:28 -07:00
Josh Durgin
237135275d librados: always free buffer allocated by md_config_t::_get_val
CID 717083: Resource leak (RESOURCE_LEAK)
At (3): Variable "str" going out of scope leaks the storage it points
to.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
e6ced04f40 librados: fix use without NULL check in rados_pool_list
CID 716911: Dereference after null check (FORWARD_NULL)
At (5): Passing null pointer "b" to function "strncat(char *, char
const *, size_t)", which dereferences it. (The dereference is assumed
on the basis of the 'nonnull' parameter attribute.)

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
f35ab0fda8 librados: init everything in default IoCtxImpl ctor
CID 717219: Uninitialized pointer field (UNINIT_CTOR)
At (14): Non-static class member "objecter" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
68b1fd66e9 rbd: make sure we have a device before trying to unmap
CID 717444: Explicit null dereferenced (FORWARD_NULL)
 At (48): Passing null pointer "devpath" to function
"do_kernel_rm(char const *)", which dereferences it.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
399fc01b62 librbd: fix list for more than 1024 format 2 images
r was not being set in the loop.

CID 716936: Infinite loop (INFINITE_LOOP)
At (1): Top of the loop.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
52943a6a70 librbd: don't allow order to be more than 64
Otherwise it will overflow a uint64_t when shifting.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
74b85e7cdf librbd: use 64-bits to shift order
Order is never actually this high currently, but it be via librbd.

CID 716937: Overflowed return value (INTEGER_OVERFLOW)
At (3): Overflowed or truncated value (or a value computed from an
overflowed or truncated value) "offset" used as return value.

CID 717012: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "1 << obj_order" with type
"int" (32 bits, signed) 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 the left operand to
"uint64_t" before performing the left shift.

CID 717011: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "1 << order" with type
"int" (32 bits, signed) 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 the left operand to
"uint64_t" before performing the left shift.

CID 717013: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "1 << order" with type
"int" (32 bits, signed) 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 the left operand to
"uint64_t" before performing the left shift.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
11da12fa49 librbd: init cookie in WatchCtx ctor
CID 717226: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "cookie" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
404d45b533 librbd: init m_req in LibrbdWriteback::C_Read ctor
CID 717225: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "m_req" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
38aeb0002e librbd: initialize on-disk header in ImageCtx ctor
CID 717224: Uninitialized scalar field (UNINIT_CTOR)
At (26): Non-static class member field "header.snaps" is not
initialized in this constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
efb2a57457 librbd: init everything in default AioRequest constructors
CID 717222: Uninitialized pointer field (UNINIT_CTOR)
At (16): Non-static class member "m_hide_enoent" is not initialized
in this constructor nor in any functions that it calls.

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

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Josh Durgin
eccf60e40b librbd: fix coverity warnings for AioCompletions
CID 717220: Uninitialized pointer field (UNINIT_CTOR)
At (4): Non-static class member "aio_type" is not initialized in this
constructor nor in any functions that it calls.

CID 717221: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "m_req" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-25 14:09:27 -07:00
Sage Weil
3ca3cd4c6c Merge branch 'next' 2012-09-24 13:16:23 -07:00
John Wilkins
7782ccb5f6 doc: Added messaging section to ref. Placeholders. Definitions needed.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-23 21:55:53 -07:00
John Wilkins
8853469040 doc: Added space for Emacs users.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-23 21:54:44 -07:00
John Wilkins
446e68cfda doc: Added journal section placeholders. Definitions needed.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-23 21:54:20 -07:00
John Wilkins
04ddd14e09 doc: Fixed hyperlink.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-23 21:53:36 -07:00
John Wilkins
abf1bf4375 doc: Clean up and added placeholders for new definitions.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-23 21:52:43 -07:00
John Wilkins
78439e96b8 doc: Fixed hyperlink.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-23 21:51:43 -07:00
John Wilkins
873ccdfe2c doc: Fixed hyperlink.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-23 21:51:26 -07:00
John Wilkins
441ae009fc doc: Restored "Differences from Posix" to /doc/dev
Fixes: #3185

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-23 21:50:53 -07:00
Sam Lang
153fb3bd50 doc: Adds package deps to list in README
The README provides a list of packages needed to successfully
configure ceph.  uuid-dev and libatomic-ops-dev are missing from
the list.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-09-23 16:58:46 -07:00
Sage Weil
720a30173d mon: tolerate no session on no_reply()
We remove the Session* in ms_handle_reset().

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-21 21:05:27 -07:00
Sage Weil
3b4f754a18 msg/Accepter: assert that listen_sd always >= 0
The listen_sd is set by bind(); we should never call stop() when it is
is still negative.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-21 10:17:00 -07:00
Sage Weil
f13eaf4ca8 msg/Accepter: fix race in accepter shutdown
We want to avoid a race like:

- entry() starts, populates pfd with listen_sd, gets past !done check
- stop() does shutdown + close on listen_sd
- someone else opens a new fd
- entry() thread calls poll(2) on wrong sd
- stop() calls join, waits forever for entry thread

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-21 10:17:00 -07:00
Yehuda Sadeh
0c7637d6d8 rgw: prepare_update_index should not error on system bucket
Should just return true. This way we don't need higher level
functions to be aware of system buckets. Also, don't use
marker.empty() to test for system bucket, use bucket_is_system().

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2012-09-21 09:53:49 -07:00
Sage Weil
9aa467dfc6 ceph-object-corpus: update with v0.52 objects
These were generated a few days prior to v0.52 release, but well after
freeze.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-20 16:49:57 -07:00
Samuel Just
a69593b8ec Merge remote-tracking branch 'upstream/wip-osd-qlock' 2012-09-20 16:11:05 -07:00
Sage Weil
58ad4dd296 uuid: include unistd to make encode testing work
The expanded encode/decode macros need getpid(2) and close(2).

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-20 15:40:13 -07:00
Sage Weil
0c07607fb8 qa: move all rados class unit tests into qa/workunits/cls
This includes the existing rbd one; teh suite is getting fixed to match.

See #3097.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-20 15:12:39 -07:00
Sage Weil
420baa9008 Makefile: rename test_rados_api_cls_lock -> test_cls_lock
Keep this consistent with the other rados classes

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-20 15:11:19 -07:00
Sam Lang
e975fec6f9 Merge branch 'wip-vstartfixes'
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage.weil@inktank.com>
2012-09-20 14:25:56 -07:00
Sam Lang
69743c123c vstart.sh: Alternative fix for vstart.sh -n
The previous fix (0f7c516f3e) breaks osd startup with -k.  This one
from dmick just tells the ceph-mon which keyring to use through the
command line rather than moving the keyring path to the [global]
section of the config file.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-09-20 14:22:01 -07:00
Gary Lowell
c9e81fdb3c Makefile.am: librdb_fsx test needs math library on some platforms 2012-09-20 13:47:09 -07:00
Sage Weil
5d2c59e0f8 Merge remote-tracking branch 'gh/wip-1957'
Reviewed-by: Sage Weil <sage@inktank.com>
2012-09-20 11:54:17 -07:00
Sage Weil
93cd73f147 doc: link to full 0.48.2 changelog
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-20 11:51:49 -07:00
Yan, Zheng
8276fa2901 mds: Clean up finished two phase commits
When handling master request with slaves, the mds could crash
after receiving all slaves' commit acknowledgement, but before
journalling the ECommitted. Current MDS recovery code does not
handle this case correctly, the request will be left in
LogSegment's uncommitted_masters after recovery is finished.
It prevents LogSegment from being trimmed. The fix is find and
clean up request of this kind when recovery enters rejoin stage.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-20 11:09:40 -07:00
Sam Lang
4d3955350a cfuse: Define CEPH_INO_DOTDOT (3) for top-level parentdir
Defines the macro CEPH_INO_DOTDOT (to 3) and uses it as the top-level
parent directory (..) inode number.  The value of 2 is already taken
by the .ceph hidden directory.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-09-20 10:58:02 -07:00
Sage Weil
671c4c32f4 ceph_common.sh: 'hostname -s' (instead of cut ...)
This will also match up with the instructions in the docs.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-20 10:12:30 -07:00
Sage Weil
51d58159a3 doc: v0.48.2argonaut release notes
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-20 09:42:58 -07:00
Sam Lang
fd205da183 cfuse: Add the parent entry (..) for a top-level readdir
In the lowlevel fuse api, the current (.) and parent (..) entries
must be added manually in a readdir call.  For the root directory
the parent is not a ceph inode, so we give it a fake inode value
(2) and intercept that inode on a getattr.

Fixes: #1957
Signed-off-by: Sam Lang <sam.lang@inktank.com>
2012-09-19 17:47:21 -07:00
Sage Weil
db94347d91 Merge branch 'wip-mon'
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
2012-09-19 17:05:45 -07:00
John Wilkins
d5a048cec5 doc: Removed legacy doc. Not needed.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-19 16:28:40 -07:00
John Wilkins
9fa5720846 doc: Removed legacy doc. Not needed.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-19 16:28:01 -07:00
John Wilkins
64198f8a15 doc: Removed legacy doc. Not needed.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-19 16:27:16 -07:00
John Wilkins
d50aab8442 doc: Added enabling Swift access to rgw config.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2012-09-19 16:26:40 -07:00