]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agomds: simplify get_dirfrag()
Sage Weil [Sat, 29 Sep 2012 08:27:33 +0000 (01:27 -0700)]
mds: simplify get_dirfrag()

Avoid useless have_inode() call.

CID 716996: Dereference null return value (NULL_RETURNS)
At (13): Dereferencing a pointer that might be null "this->get_inode(df.ino, snapid_t(18446744073709551614UL))" when calling "CInode::get_dirfrag(frag_t)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix mlogger shutdown
Sage Weil [Sat, 29 Sep 2012 08:26:05 +0000 (01:26 -0700)]
mds: fix mlogger shutdown

CID 716880: Copy-paste error (COPY_PASTE_ERROR)
At (2): "logger" in "this->logger" looks like a copy-paste error. Should it say "mlogger" instead?

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix leak from get_current_dir_name
Sage Weil [Sat, 29 Sep 2012 08:25:25 +0000 (01:25 -0700)]
mds: fix leak from get_current_dir_name

CID 717086: Resource leak (RESOURCE_LEAK)
At (18): Ignoring storage allocated by "get_current_dir_name()" leaks it.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: simplify math
Sage Weil [Sat, 29 Sep 2012 08:22:19 +0000 (01:22 -0700)]
librbd: simplify math

Bending over backwards hasn't made coveirty happy.  We'll just ignore it
there.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: add assert to lock path
Sage Weil [Sat, 29 Sep 2012 08:17:21 +0000 (01:17 -0700)]
mds: add assert to lock path

This makes coverity happy:

CID 716916: Explicit null dereferenced (FORWARD_NULL)
At (28): Passing null pointer "in" to function "MDSCacheObject::state_test(unsigned int) const", which dereferences it. [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix uninit Dumper fields in ctor
Sage Weil [Sat, 29 Sep 2012 08:16:16 +0000 (01:16 -0700)]
mds: fix uninit Dumper fields in ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix fd leak in dumper
Sage Weil [Sat, 29 Sep 2012 08:14:58 +0000 (01:14 -0700)]
mds: fix fd leak in dumper

CID 717084: Resource leak (RESOURCE_LEAK)
At (6): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix uninit Capability::last_issue
Sage Weil [Sat, 29 Sep 2012 08:12:53 +0000 (01:12 -0700)]
mds: fix uninit Capability::last_issue

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix uninit field in CInode
Sage Weil [Sat, 29 Sep 2012 08:11:41 +0000 (01:11 -0700)]
mds: fix uninit field in CInode

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix typo in rsubdirs warning
Sage Weil [Sat, 29 Sep 2012 08:09:43 +0000 (01:09 -0700)]
mds: fix typo in rsubdirs warning

CID 716879: Copy-paste error (COPY_PASTE_ERROR)
At (2): "rfiles" in "pi->rstat.rfiles" looks like a copy-paste error. Should it say "rsubdirs" instead?

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: init CDir fields
Sage Weil [Sat, 29 Sep 2012 08:08:30 +0000 (01:08 -0700)]
mds: init CDir fields

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: avoid useless have_inode() call
Sage Weil [Sat, 29 Sep 2012 08:06:38 +0000 (01:06 -0700)]
mds: avoid useless have_inode() call

CID 716989: Dereference null return value (NULL_RETURNS)
At (83): Dereferencing a pointer that might be null "in" when calling "operator <<(std::ostream &, CInode &)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: pass by value
Sage Weil [Sat, 29 Sep 2012 07:59:54 +0000 (00:59 -0700)]
osd: pass by value

CID 717054: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter recovery_info of type ObjectRecoveryInfo (size 640 bytes) by value.

and more

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: fix coverity NULL warning
Sage Weil [Sat, 29 Sep 2012 07:57:40 +0000 (00:57 -0700)]
osd: fix coverity NULL warning

Session is alwasy set on requests.

CID 717008: Dereference null return value (NULL_RETURNS)
At (34): Dereferencing a pointer that might be null "session" when calling "OSD::Session::del_notif(void *)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: logger is never NULL
Sage Weil [Sat, 29 Sep 2012 07:53:28 +0000 (00:53 -0700)]
osd: logger is never NULL

We set this up in init(), so we don't need to make these dereferences
conditional.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd/PG: remove redundant NamedState
Sage Weil [Sat, 29 Sep 2012 07:51:08 +0000 (00:51 -0700)]
osd/PG: remove redundant NamedState

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: init all vars in PG::NamedState
Sage Weil [Sat, 29 Sep 2012 07:50:57 +0000 (00:50 -0700)]
osd: init all vars in PG::NamedState

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph tool: fix cli test
Sage Weil [Sat, 29 Sep 2012 01:34:26 +0000 (18:34 -0700)]
ceph tool: fix cli test

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: fix uninit var warning in session startup
Sage Weil [Sat, 29 Sep 2012 01:16:49 +0000 (18:16 -0700)]
mon: fix uninit var warning in session startup

This is a false positive; just init the var.

CID 717198: Uninitialized scalar variable (UNINIT)
At (18): Using uninitialized value "auid" when calling "MonCaps::set_auid(uint64_t)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofilstore: fix leak of fd in write error paths
Sage Weil [Sat, 29 Sep 2012 01:14:24 +0000 (18:14 -0700)]
filstore: fix leak of fd in write error paths

CID 717095: Resource leak (RESOURCE_LEAK)
At (13): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofilestore: fix fd leak
Sage Weil [Sat, 29 Sep 2012 01:12:34 +0000 (18:12 -0700)]
filestore: fix fd leak

CID 717088: Resource leak (RESOURCE_LEAK)
At (11): Handle variable "tmpfd" going out of scope leaks the handle.

Also unlink the file.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: dentry always has dir
Sage Weil [Sat, 29 Sep 2012 00:56:34 +0000 (17:56 -0700)]
mds: dentry always has dir

CID 716912: Dereference after null check (FORWARD_NULL)
At (3): Passing null pointer "this->dir" to function "CDir::ino() const", which dereferences it. [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: init value in CopyProgressCtx ctor
Sage Weil [Sat, 29 Sep 2012 00:54:34 +0000 (17:54 -0700)]
librbd: init value in CopyProgressCtx ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: fix overflow assert check
Sage Weil [Sat, 29 Sep 2012 00:53:29 +0000 (17:53 -0700)]
librbd: fix overflow assert check

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph tool: update url in man page
Sage Weil [Sat, 29 Sep 2012 00:38:02 +0000 (17:38 -0700)]
ceph tool: update url in man page

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph tool: document 'ceph osd map ...' command
Sage Weil [Sat, 29 Sep 2012 00:37:53 +0000 (17:37 -0700)]
ceph tool: document 'ceph osd map ...' command

Closes: #3223
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-coverity-common'
Sage Weil [Sat, 29 Sep 2012 00:31:41 +0000 (17:31 -0700)]
Merge remote-tracking branch 'gh/wip-coverity-common'

Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge branch 'next'
Samuel Just [Fri, 28 Sep 2012 23:31:27 +0000 (16:31 -0700)]
Merge branch 'next'

12 years agoFileStore: use fresh vector for calls for listing collection
Samuel Just [Fri, 28 Sep 2012 23:19:56 +0000 (16:19 -0700)]
FileStore: use fresh vector for calls for listing collection

In collection_list_range, use an empty vector to pass into
collection_list_partial.  collection_list_partial stops
listing when the output vector exceeds the specified max.
If this happens before we hit the end of the range,
collection_list_range will spin forever.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Mike Ryan <mike.ryan@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoosdmap: restore stream format
Sage Weil [Fri, 28 Sep 2012 17:31:29 +0000 (10:31 -0700)]
osdmap: restore stream format

CID 727986: Not restoring ostream format (STREAM_FORMAT_STATE)
At (20): Changing format state of stream "out" for category precision without later restoring it.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocephtool: fix resource leak
Sage Weil [Fri, 28 Sep 2012 15:09:09 +0000 (08:09 -0700)]
cephtool: fix resource leak

CID 717124: Resource leak (RESOURCE_LEAK)
At (17): Variable "m" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocls_refcount: fix uninit vals in ctor
Sage Weil [Fri, 28 Sep 2012 15:06:19 +0000 (08:06 -0700)]
cls_refcount: fix uninit vals in ctor

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

+ a few others

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorados: fix error paths in do_put()
Sage Weil [Fri, 28 Sep 2012 15:03:11 +0000 (08:03 -0700)]
rados: fix error paths in do_put()

CID 716986: Improper use of negative value (NEGATIVE_RETURNS)
At (9): "count" is passed to a parameter that cannot be negative. [hide details]

+ other stuff

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdmaptool: fix pg_t::parse() return value check
Sage Weil [Fri, 28 Sep 2012 14:55:45 +0000 (07:55 -0700)]
osdmaptool: fix pg_t::parse() return value check

CID 716876: Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
At (1): pgid.parse(test_map_pg.c_str()) < 0 is always false regardless of the values of its operands. This occurs as the logical operand of if.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdmaptool: check return values
Sage Weil [Fri, 28 Sep 2012 14:55:08 +0000 (07:55 -0700)]
osdmaptool: check return values

CID 716864: Unchecked return value (CHECKED_RETURN)
At (155): Calling function "ceph::buffer::list::read_file(char const *, std::string *)" without checking return value (as is done elsewhere 14 out of 16 times).

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoobjecter: fix dereference after null check
Sage Weil [Fri, 28 Sep 2012 14:53:04 +0000 (07:53 -0700)]
objecter: fix dereference after null check

CID 716933: Dereference after null check (FORWARD_NULL)
At (4): Passing null pointer "extra_ops->ops" to function "std::vector<OSDOp, std::allocator<OSDOp> >::operator [](std::vector<OSDOp, std::allocator<OSDOp> >::size_type)", which dereferences it. [hide details]

All callers pass 1, but this was also hard-coded into the helper logic.
Fix code (and doxygen desc) to allow other values.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoobjectcacher: fix uninit var in ctor
Sage Weil [Fri, 28 Sep 2012 14:45:49 +0000 (07:45 -0700)]
objectcacher: fix uninit var in ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoobjectcacher: fix uninit it ctor
Sage Weil [Fri, 28 Sep 2012 14:44:18 +0000 (07:44 -0700)]
objectcacher: fix uninit it ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoobjectcacher: avoid confusing coverity
Sage Weil [Fri, 28 Sep 2012 14:42:20 +0000 (07:42 -0700)]
objectcacher: avoid confusing coverity

CID 716932: Explicit null dereferenced (FORWARD_NULL)
At (21): Passing null pointer "final" to function "ObjectCacher::BufferHead::end() const", which dereferences it. [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agojournaler: uninit var in ctor
Sage Weil [Fri, 28 Sep 2012 14:36:27 +0000 (07:36 -0700)]
journaler: uninit var in ctor

CID 717349: Uninitialized scalar field (UNINIT_CTOR)
At (14): 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 agojournaler: uninit var in ctor
Sage Weil [Fri, 28 Sep 2012 14:35:39 +0000 (07:35 -0700)]
journaler: uninit var in ctor

CID 717348: Uninitialized scalar field (UNINIT_CTOR)
At (14): 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 agofiler: fix overflow
Sage Weil [Fri, 28 Sep 2012 14:35:20 +0000 (07:35 -0700)]
filer: fix overflow

CID 717017: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "layout->fl_stripe_count.operator unsigned int() * layout->fl_object_size.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.

+ more

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMOSDFailure: avoid big pass by value
Sage Weil [Fri, 28 Sep 2012 14:32:22 +0000 (07:32 -0700)]
MOSDFailure: avoid big pass by value

CID 727975: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter f of type entity_inst_t (size 152 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMMonJoin: avoid large pass by value
Sage Weil [Fri, 28 Sep 2012 14:31:44 +0000 (07:31 -0700)]
MMonJoin: avoid large pass by value

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMRoute: avoid pass by value
Sage Weil [Fri, 28 Sep 2012 14:30:09 +0000 (07:30 -0700)]
MRoute: avoid pass by value

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomessages: uninit values
Sage Weil [Fri, 28 Sep 2012 14:29:16 +0000 (07:29 -0700)]
messages: uninit values

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

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

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

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

+ more

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomsg/Messenger: avoid large pass by value
Sage Weil [Fri, 28 Sep 2012 14:19:38 +0000 (07:19 -0700)]
msg/Messenger: avoid large pass by value

CID 717049: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter bind_addr of type entity_addr_t (size 136 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomsg/Accepter: check getsockbyname() return value
Sage Weil [Fri, 28 Sep 2012 14:15:07 +0000 (07:15 -0700)]
msg/Accepter: check getsockbyname() return value

CID 717442: Other violation (CHECKED_RETURN)
At (10): Calling function "getsockname(this->listen_sd, (sockaddr *)listen_addr.ss_addr(), &llen)" without checking return value. This library function may fail and return an error code.
At (11): No check of the return value of "getsockname(this->listen_sd, (sockaddr *)listen_addr.ss_addr(), &llen)".

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoLogEntry: fix uninit in ctor
Sage Weil [Fri, 28 Sep 2012 14:12:39 +0000 (07:12 -0700)]
LogEntry: fix uninit in ctor

At (2): Non-static class member "m_thread" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "m_prio" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "m_subsys" is not initialized in this constructor nor in any functions that it calls.
CID 717229: Uninitialized scalar field (UNINIT_CTOR)
At (8): Non-static class member "m_static_buf" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoutime: restore ostream state
Sage Weil [Fri, 28 Sep 2012 14:10:05 +0000 (07:10 -0700)]
utime: restore ostream state

CID 717130: Not restoring ostream format (STREAM_FORMAT_STATE)
At (4): Changing format state of stream "out" for category fill without later restoring it.

CID 717131: Not restoring ostream format (STREAM_FORMAT_STATE)
At (4): Changing format state of stream "out" for category fill without later restoring it.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agostringify: use const ref
Sage Weil [Fri, 28 Sep 2012 14:09:33 +0000 (07:09 -0700)]
stringify: use const ref

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoaddr_parsing: fix memory leak
Sage Weil [Fri, 28 Sep 2012 14:05:27 +0000 (07:05 -0700)]
addr_parsing: fix memory leak

CID 717082: Resource leak (RESOURCE_LEAK)
At (4): Variable "buf" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agopidfile: fix fd leak from pidfile_remove()
Sage Weil [Fri, 28 Sep 2012 14:04:06 +0000 (07:04 -0700)]
pidfile: fix fd leak from pidfile_remove()

CID 717081: Resource leak (RESOURCE_LEAK)
At (10): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocrushtester: fix uninit var
Sage Weil [Fri, 28 Sep 2012 14:00:12 +0000 (07:00 -0700)]
crushtester: fix uninit var

CID 717197: Uninitialized scalar variable (UNINIT)
At (35): Using uninitialized value "only_osd_affected".

Fix some whitespace too.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocrushtester: avoid divide by zero
Sage Weil [Fri, 28 Sep 2012 13:57:58 +0000 (06:57 -0700)]
crushtester: avoid divide by zero

CID 716906: Division or modulo by zero (DIVIDE_BY_ZERO)
At (214): In expression "(float)weight[i] / (float)total_weight", division by expression "total_weight" which may be zero has undefined behavior.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agocrushtester: avoid divide by zero
Sage Weil [Fri, 28 Sep 2012 13:56:20 +0000 (06:56 -0700)]
crushtester: avoid divide by zero

CID 716904: Division or modulo by zero (DIVIDE_BY_ZERO)
At (4): In expression "(float)weight[i] / (float)total_weight", division by expression "total_weight" which may be zero has undefined behavior.

At (8): On this path, function call "this->crush->get_max_devices()" has return value of 0
CID 716905: Division or modulo by zero (DIVIDE_BY_ZERO)
At (9): In expression "lrand48() % this->crush->get_max_devices()" modulo by expression "this->crush->get_max_devices()" which may be zero has undefined behavior.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoadminsocket: fix sock-fd leak in failure path
Sage Weil [Fri, 28 Sep 2012 13:48:11 +0000 (06:48 -0700)]
adminsocket: fix sock-fd leak in failure path

CID 728088: Resource leak (RESOURCE_LEAK)
At (9): Handle variable "sock_fd" going out of scope leaks the handle.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoPrebufferedStream: avoid dereferencing end()
Sage Weil [Fri, 28 Sep 2012 13:45:06 +0000 (06:45 -0700)]
PrebufferedStream: avoid dereferencing end()

This appeared to work, but probably isn't a good idea.

CID 716940: Using invalid iterator (INVALIDATE_ITERATOR)
At (4): Dereferencing iterator "this->m_overflow.end()" though it is already past the end of its container.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoperfcounters: remove unused members
Sage Weil [Fri, 28 Sep 2012 04:03:02 +0000 (21:03 -0700)]
perfcounters: remove unused members

Avoids coverity warning

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoobj_bencher: protect with lock
Sage Weil [Fri, 28 Sep 2012 03:55:37 +0000 (20:55 -0700)]
obj_bencher: protect with lock

This makes coverity happy.

CID 716963: Data race condition (MISSING_LOCK)
At (1): Accessing "this->data.finished" ("bench_data.finished") requires the "Mutex._m" lock.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoobj_bencher: possible divice by zero
Sage Weil [Fri, 28 Sep 2012 01:21:08 +0000 (18:21 -0700)]
obj_bencher: possible divice by zero

CID 716903: Division or modulo by zero (DIVIDE_BY_ZERO) [select defect]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolockep: fix leak in failure/assert path
Sage Weil [Fri, 28 Sep 2012 01:20:46 +0000 (18:20 -0700)]
lockep: fix leak in failure/assert path

This is useless excepto make coverity happy.

CID 717075: Resource leak (RESOURCE_LEAK)
At (12): Variable "bt" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoipaddr: fix buffer overrun on ipv6 prefix of 128
Sage Weil [Fri, 28 Sep 2012 01:17:08 +0000 (18:17 -0700)]
ipaddr: fix buffer overrun on ipv6 prefix of 128

CID 717020: Out-of-bounds read (OVERRUN)
At (3): Overrunning array "addr->__in6_u.__u6_addr8" of 16 bytes at byte offset 16 using index "prefix_len / 8U" (which evaluates to 16).

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoconfig: don't leak buf on dump config
Sage Weil [Fri, 28 Sep 2012 01:15:11 +0000 (18:15 -0700)]
config: don't leak buf on dump config

CID 717074: Resource leak (RESOURCE_LEAK)
At (26): Variable "buf" going out of scope leaks the storage it points to.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agobuffer: init data val in ctor
Sage Weil [Fri, 28 Sep 2012 01:13:24 +0000 (18:13 -0700)]
buffer: init data val in ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agobuffer: restore stream state after hexdump()
Sage Weil [Fri, 28 Sep 2012 01:12:20 +0000 (18:12 -0700)]
buffer: restore stream state after hexdump()

CID 717129: Not restoring ostream format (STREAM_FORMAT_STATE)
At (51): Changing format state of stream "out" for category fill without later restoring it.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoadminsocket: init vars in ctor
Sage Weil [Fri, 28 Sep 2012 01:11:51 +0000 (18:11 -0700)]
adminsocket: init vars in ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoadminsocket: change failure test
Sage Weil [Fri, 28 Sep 2012 01:02:45 +0000 (18:02 -0700)]
adminsocket: change failure test

This makes coverity happier:

CID 716941: Using invalid iterator (INVALIDATE_ITERATOR)
At (35): Dereferencing iterator "p" though it is already past the end of its container.

only because it doesn't understand all the side-effects of the failure
branch above.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoadminsocket: check return value
Sage Weil [Fri, 28 Sep 2012 01:02:10 +0000 (18:02 -0700)]
adminsocket: check return value

CID 716847: Other violation (CHECKED_RETURN)
At (5): Calling function "fcntl(sock_fd, 2, 1)" without checking return value. This library function may fail and return an error code.
At (6): No check of the return value of "fcntl(sock_fd, 2, 1)".

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoworkqueue: reset heartbeat timeout under lock
Sage Weil [Fri, 28 Sep 2012 00:55:28 +0000 (17:55 -0700)]
workqueue: reset heartbeat timeout under lock

This makes coverity happier:

CID 727967: Value not atomically updated (ATOMICITY)
At (44): Using an unreliable value of "hb" inside the second locked section. If the data that "hb" depends on was changed by another thread, this use might be incorrect.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMemoryModel: init in ctor
Sage Weil [Fri, 28 Sep 2012 00:49:44 +0000 (17:49 -0700)]
MemoryModel: init in ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoLogEntry: init in ctor
Sage Weil [Fri, 28 Sep 2012 00:48:26 +0000 (17:48 -0700)]
LogEntry: init in ctor

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: Added commentary for BMC and VLAN.
John Wilkins [Thu, 27 Sep 2012 23:50:16 +0000 (16:50 -0700)]
doc: Added commentary for BMC and VLAN.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoceph.spec.in: Build rpms with nss instead of cryptopp.
Gary Lowell [Fri, 28 Sep 2012 19:27:14 +0000 (19:27 +0000)]
ceph.spec.in:  Build rpms with nss instead of cryptopp.

12 years agovstart.sh: let you specific specific ip to bind to
Sage Weil [Fri, 28 Sep 2012 15:24:23 +0000 (08:24 -0700)]
vstart.sh: let you specific specific ip to bind to

e.g. 192.168.122.1

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'master' of https://github.com/ceph/ceph
John Wilkins [Thu, 27 Sep 2012 23:50:47 +0000 (16:50 -0700)]
Merge branch 'master' of https://github.com/ceph/ceph

12 years agodoc: Added commentary for BMC and VLAN.
John Wilkins [Thu, 27 Sep 2012 23:50:16 +0000 (16:50 -0700)]
doc: Added commentary for BMC and VLAN.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-osd-caps'
Sage Weil [Thu, 27 Sep 2012 23:34:03 +0000 (16:34 -0700)]
Merge remote-tracking branch 'gh/wip-osd-caps'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agotest: add more OSDCap unit tests
Josh Durgin [Thu, 27 Sep 2012 22:24:03 +0000 (15:24 -0700)]
test: add more OSDCap unit tests

Check that allow_all() returns false when 'allow *' is not specified.
This would have caught #3228.
Add tests for the output operators as well.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSDCaps: fix allow_all()
Josh Durgin [Thu, 27 Sep 2012 21:44:57 +0000 (14:44 -0700)]
OSDCaps: fix allow_all()

OSD_CAP_ANY is not a mask. Treating it as one made any allowance
equivalent to 'allow *'.

Fixes: #3228
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSDCap: fix output operators for caps
Josh Durgin [Thu, 27 Sep 2012 21:41:24 +0000 (14:41 -0700)]
OSDCap: fix output operators for caps

OSD_CAP_ANY is not a flag, but a value (0xff) that will always
be true when treated as a mask with a non-zero rwxa_t.

Don't duplicate the rwxa_t output operator in the OSDCapSpec output
operator, just use it.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSDCap: fix typo in comment
Josh Durgin [Wed, 26 Sep 2012 23:54:37 +0000 (16:54 -0700)]
OSDCap: fix typo in comment

The grammar uses auid, not uid.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: RST cleanup for RPM dev package installs.
John Wilkins [Thu, 27 Sep 2012 22:02:42 +0000 (15:02 -0700)]
doc: RST cleanup for RPM dev package installs.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Removed old ops directory structure and redundant files.
John Wilkins [Thu, 27 Sep 2012 22:02:05 +0000 (15:02 -0700)]
doc: Removed old ops directory structure and redundant files.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoclient: add WARN_UNUSED_RESULT to client init func
Sam Lang [Mon, 24 Sep 2012 21:09:43 +0000 (14:09 -0700)]
client: add WARN_UNUSED_RESULT to client init func

Adds the gcc attribute (if available) to client init functions to
ensure proper error handling.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Remove unmaintained ldceph.cc from tree
Sam Lang [Mon, 24 Sep 2012 20:37:52 +0000 (13:37 -0700)]
client: Remove unmaintained ldceph.cc from tree

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Mods to fix #3184 for messenger shutdown
Sam Lang [Mon, 24 Sep 2012 20:31:15 +0000 (13:31 -0700)]
client: Mods to fix #3184 for messenger shutdown

This moves the shutdown of the messenger outside of the client
to be able to handle error cases more appropriately.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoRefresh manpages from .rst sources
Dan Mick [Thu, 27 Sep 2012 21:23:42 +0000 (14:23 -0700)]
Refresh manpages from .rst sources

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agomanpage-howto.txt: note that man/Makefile.am may need update too
Dan Mick [Thu, 27 Sep 2012 21:32:28 +0000 (14:32 -0700)]
manpage-howto.txt: note that man/Makefile.am may need update too

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoAdd howto for changing man pages
Dan Mick [Thu, 27 Sep 2012 21:20:04 +0000 (14:20 -0700)]
Add howto for changing man pages

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agomon: update 'auth' help/usage
Sage Weil [Thu, 27 Sep 2012 21:15:39 +0000 (14:15 -0700)]
mon: update 'auth' help/usage

Fixes: #3227
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorados: fix man page
Sage Weil [Thu, 27 Sep 2012 21:10:51 +0000 (14:10 -0700)]
rados: fix man page

Default bench IO size if 4MB.

Fixes: 3230
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: fix rpm url (part deux)
Sage Weil [Thu, 27 Sep 2012 21:00:40 +0000 (14:00 -0700)]
doc: fix rpm url (part deux)

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-watch-header-race'
Sage Weil [Thu, 27 Sep 2012 20:37:52 +0000 (13:37 -0700)]
Merge remote-tracking branch 'gh/wip-watch-header-race'

12 years agolibrbd: fix includes for portability
Josh Durgin [Wed, 26 Sep 2012 23:58:32 +0000 (16:58 -0700)]
librbd: fix includes for portability

This needs limits.h for Centos, and the inttypes.h wrapper for FreeBSD.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-osd'
Sage Weil [Thu, 27 Sep 2012 20:33:45 +0000 (13:33 -0700)]
Merge remote-tracking branch 'gh/wip-osd'

Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agorgw: check that realloc succeeded
Yehuda Sadeh [Wed, 22 Aug 2012 17:04:59 +0000 (10:04 -0700)]
rgw: check that realloc succeeded

Was missing a test after a realloc.

Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoReplicatedPG: track incoming pushes with perf counters
Mike Ryan [Fri, 21 Sep 2012 16:49:39 +0000 (09:49 -0700)]
ReplicatedPG: track incoming pushes with perf counters

Add perf counters tracking the number of inbound pushes along with the
amount of data in each request.

Signed-off-by: Mike Ryan <mike.ryan@inktank.com>
12 years agoPG: explicitely delay ops on backfill_pos
Samuel Just [Mon, 24 Sep 2012 21:33:17 +0000 (14:33 -0700)]
PG: explicitely delay ops on backfill_pos

Previously, we considered backfill_pos degraded in order to delay
ops since a write to backfill_pos could generate a snap before
backfill_pos, and we assume that (0, backfill_pos) is fully
backfilled.  This is a problem since it's possible that
backfill_pos is a valid object, but not one that currently exists.
For example, it might have been deleted since last_backfill was
last changed.  Instead, we will explicitly delay ops on
backfill_pos in waiting_for_backfill_pos.

This error resulted in #2691 since wait_for_degraded_object also
attempts to recover the object. At this point, the primary would
attempt to recover the object, find that it isn't there, and put
it in the missing set with need=0,0.  Eventually, recover_primary
attempts to recover that object, finds that it has been deleted
in the log, and asserts.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip_backfill_full2'
Sage Weil [Thu, 27 Sep 2012 20:21:23 +0000 (13:21 -0700)]
Merge remote-tracking branch 'gh/wip_backfill_full2'

Conflicts:
src/include/ceph_features.h