Commit Graph

21468 Commits

Author SHA1 Message Date
Josh Durgin
a204058a9a 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-24 17:42:13 -07:00
Josh Durgin
7df76de6ac 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-24 17:42:05 -07:00
Josh Durgin
118c21276c 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-24 17:41:51 -07:00
Josh Durgin
cd3d3aa692 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-24 17:41:49 -07:00
Josh Durgin
073786eb34 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-24 17:41:48 -07:00
Josh Durgin
dea894d47e 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-24 17:41:45 -07:00
Josh Durgin
c1ffe08c18 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-24 17:41:30 -07:00
Josh Durgin
3486050ddc 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-24 17:41:08 -07:00
Sage Weil
3ca3cd4c6c Merge branch 'next' 2012-09-24 13:16:23 -07:00
Samuel Just
86b3e8aeb3 OSD: add init and shutdown for OSDService
Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-09-24 12:29:55 -07:00
Josh Durgin
e177680903 librbd: ensure header is up to date after initial read
Use an assert version op in combination with our watch, and re-read
the header until it's not stale. Header updates are infrequent, so
this should not cause any delay with normal use.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-24 12:09:46 -07:00
Josh Durgin
5cba77828a librados: note that watch's version param is ignored
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-09-24 11:57:34 -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
e32ee37555 librados: cleanup: use Mutex::Locker
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-21 22:36:41 -07:00
Sage Weil
d1de1f1215 librados: protect lookup_pool, get_pool_name with lock
Fixes: #2525
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-21 22:36:08 -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
Samuel Just
a794c936ff ReplicatedPG: set op return version to pg version on ENOENT
This will be useful for detecting read-delete races in
radosgw.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2012-09-21 18:11:12 -07:00
Sage Weil
53b18e3ce6 osd: catch decoding errors from client ops
Check for decode errors in client ops and return -EINVAL.

Fixes: #2500
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-21 17:55:08 -07:00
Sage Weil
ef29d90ef2 osd: some whitespace
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-21 17:39:01 -07:00
Sage Weil
a73777a902 osd: return -EPERM on insufficient caps
Send a failure to the client instead of dropping the request on the floor.

Fixes: #3066
Signed-off-by: Sage Weil <sage@inktank.com>
2012-09-21 17:38:24 -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