Samuel Just [Wed, 29 Aug 2012 22:55:23 +0000 (15:55 -0700)]
osd/ClassHandler.cc: uninit var in ctor
CID 717336: Uninitialized pointer field (UNINIT_CTOR)At (2): Non-static class
member "handler" is not initialized in this constructor nor in any functions
that it calls.
Samuel Just [Wed, 29 Aug 2012 22:53:32 +0000 (15:53 -0700)]
osd/ClassHandler: uninit var in ctor
CID 717335: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "flags" is not initialized in this constructor nor in any functions that
it calls.
Sage Weil [Sat, 25 Aug 2012 23:01:10 +0000 (16:01 -0700)]
monclient: uninit var in ctor
CID 717328: Uninitialized scalar field (UNINIT_CTOR) [select defect]
At (2): Non-static class member "newest" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Sat, 25 Aug 2012 22:59:43 +0000 (15:59 -0700)]
mon/MonitorStore: uninit var in ctor
CID 717329: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "lock_fd" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Sat, 25 Aug 2012 22:58:57 +0000 (15:58 -0700)]
paxos: init vars in ctr
At (2): Non-static class member "latest_stashed" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "num_last" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "uncommitted_v" is not initialized in this constructor nor in any functions that it calls.
CID 717330: Uninitialized scalar field (UNINIT_CTOR)
At (8): Non-static class member "uncommitted_pn" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Sat, 25 Aug 2012 03:07:20 +0000 (20:07 -0700)]
msg/Accepter: move nonce init to ctor
This was suggested by Greg too but I was too lazy.
CID 717331: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "nonce" is not initialized in this constructor nor in any functions that it calls.
Sage Weil [Sat, 25 Aug 2012 03:02:14 +0000 (20:02 -0700)]
log: protect m_stop with lock
CID 716965: Data race condition (MISSING_LOCK)
At (2): Accessing "this->m_stop" ("_ZN4ceph3log3LogE.m_stop") requires the "_ZN4ceph3log3LogE.m_queue_mutex" lock.
This isn't strictly needed since we assume only one thread will call this
method and start a thead, but it makes coverity happy.
Sage Weil [Fri, 24 Aug 2012 23:45:29 +0000 (16:45 -0700)]
msg/Accepter: check setsockopt return value
CCID 716856: Other violation (CHECKED_RETURN)
At (7): Calling function "setsockopt(this->listen_sd, 1, 2, &on, 4U)" without checking return value. This library function may fail and return an error code.
Sage Weil [Fri, 24 Aug 2012 23:38:20 +0000 (16:38 -0700)]
mds: fix broken EMetablob inode_t* return value
We pass this back to the caller, but it points to a member that is never
looked at, because the inode has already been encoded. In effect this
wasn't journaling anything useful, and the only user questioned whether it
was needed, so let's rip it out.
Sage Weil [Fri, 24 Aug 2012 23:31:25 +0000 (16:31 -0700)]
client: unconditional teardown
CID 717125: Dereference before null check (REVERSE_INULL)
At (2): Null-checking "this->objectcacher" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
Josh Durgin [Thu, 30 Aug 2012 00:30:17 +0000 (17:30 -0700)]
doc: clarify rbd man page (esp. layering)
* a clone's size can't be overridden
* note which commands require format 2
* clarify details of copy
* add examples for cloning
* add pool to map example for consistency
* fix a couple warnings and re-sync man page with rst
Tommi Virtanen [Thu, 30 Aug 2012 14:16:52 +0000 (10:16 -0400)]
upstart, ceph-create-keys: Make client.admin key generation automatic.
This should help simplify Chef etc deployments. Now (when using the
Upstart jobs), when a ceph-mon is started, ceph-create-admin-key is
triggered. If /etc/ceph/$cluster.client.admin.keyring already exists,
it does nothing; otherwise, it waits for ceph-mon to reach quorum, and
then does a "ceph auth get-or-create" to create the key, and writes it
atomically to disk.
The equivalent code can be removed from the Chef cookbook once this is
in.
Tommi Virtanen [Thu, 30 Aug 2012 14:21:29 +0000 (10:21 -0400)]
config: Add a per-name default keyring to front of keyring search path.
This lets us have e.g. /etc/ceph/ceph.client.admin.keyring that is
owned by root:admin and mode u=rw,g=r,o= without making every non-root
run of the command line tools complain and fail.
This is what the Chef cookbook has been doing for a while already.
Josh Durgin [Wed, 29 Aug 2012 00:24:47 +0000 (17:24 -0700)]
librbd: prevent racing clone and snap unprotect
If the following sequence of events occured,
a clone could be created of an unprotected snapshot:
1. A: begin clone - check that snap foo is protected
2. B: rbd unprotect snap foo
3. B: check that all pools have no clones of foo
4. B: unprotect snap foo
5. A: finish creating clone of foo, add it as a child
To stop this from happening, check at the beginning and end of
cloning that the parent snapshot is protected. If it is not,
or checking protection status fails (possibly because the parent
snapshot was removed), remove the clone and return an error.
Yehuda Sadeh [Tue, 28 Aug 2012 23:17:21 +0000 (16:17 -0700)]
rgw: clear usage map before reading usage
Fixes: #3057
Since we read usage in chunks we need to clear the
usage map before reading the next chunk, otherwise
we're going to aggregate the old data as well.
Sage Weil [Tue, 28 Aug 2012 22:14:41 +0000 (15:14 -0700)]
osd: fix waiting_for_disk assertion
If requeue is false, we won't have cleared out waiting_for_ondisk; adjust
assert placement as appropriate. Also, make sur we handle the requeue
and !op case properly (although I'm not sure offhand if/when it would
come up).
Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
Mike Ryan [Tue, 28 Aug 2012 18:57:03 +0000 (11:57 -0700)]
rados_bench: wait for completion callbacks before returning
If we don't wait for the callback, the finisher may cleanup the callback
context before the callback is actually invoked, causing a
use-after-free error.
Mike Ryan [Tue, 28 Aug 2012 18:57:03 +0000 (11:57 -0700)]
rados_bench: wait for completion callbacks before returning
If we don't wait for the callback, the finisher may cleanup the callback
context before the callback is actually invoked, causing a
use-after-free error.
Sage Weil [Mon, 27 Aug 2012 21:31:32 +0000 (14:31 -0700)]
osd: requeue dup ops inline with in-progress ops
We should requeue the dups along with the originals. This avoids
situations where, after requeue, the dups are reordered with respect to
each other. For example:
- client sends A, B, C
- osd receives A
- connection drops
- client sends A', B', C'
- osd puts A' in waiting_for_ondisk, starts B' and C'
- on_change() requeues everything
Final queue order (before this patch) is
A, B', C', A'
After this patch, the resulting queue order is
A, A', B', C'
Or somewhat more generally, it might be:
A, A', B, B', B'', C', C'', D'', ....
Fixes (another source of): #2947 Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
Yehuda Sadeh [Tue, 21 Aug 2012 22:05:38 +0000 (15:05 -0700)]
rgw: implement garbage collector
Add a garbage collector thread that is responsible for clean
up of clutter. When removing an object, store info about the
leftovers in a special gc map (via rgw objclass). A new
radosgw-admin commands to list objects in gc, and to run the
gc process manually. Also, gc processors can run in parallel,
however, each will handle a single gc shard (synchronized
using lock objclass).