]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/log
ceph.git
10 years agomon/Monitor.cc: fix potential null deref 5000/head
Danny Al-Gaaf [Tue, 14 Jul 2015 07:14:56 +0000 (09:14 +0200)]
mon/Monitor.cc: fix potential null deref

Add assert to MonSessionMap::new_session().

Fix for:

CID 1128408 (#1 of 1): Dereference before null check (REVERSE_INULL)
 check_after_deref: Null-checking s suggests that it may be
 null, but it has already been dereferenced on all paths
 leading to the check.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomon/OSDMonitor.cc: fix UNINTENDED_INTEGER_DIVISION
Danny Al-Gaaf [Tue, 9 Jun 2015 12:57:54 +0000 (14:57 +0200)]
mon/OSDMonitor.cc: fix UNINTENDED_INTEGER_DIVISION

Fix for:

CID 1297885 (#1 of 2): Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
 integer_division: Dividing integer expressions g_conf->mon_pool_quota_warn_threshold
 and 100, and then converting the integer quotient to type float. Any remainder,
 or fractional part of the quotient, is ignored.

CID 1297885 (#2 of 2): Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
 integer_division: Dividing integer expressions g_conf->mon_pool_quota_crit_threshold
 and 100, and then converting the integer quotient to type float. Any remainder,
  or fractional part of the quotient, is ignored.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agorgw/rgw_admin.cc: remove no longer valid comment
Danny Al-Gaaf [Tue, 14 Jul 2015 06:42:05 +0000 (08:42 +0200)]
rgw/rgw_admin.cc: remove no longer valid comment

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoos/KeyValueStore.cc: pass const parameter by reference
Danny Al-Gaaf [Thu, 9 Jul 2015 08:24:21 +0000 (10:24 +0200)]
os/KeyValueStore.cc: pass const parameter by reference

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoosdc/Journaler.cc: fix integer overflow
Danny Al-Gaaf [Wed, 17 Jun 2015 17:53:42 +0000 (19:53 +0200)]
osdc/Journaler.cc: fix integer overflow

Fix for:

CID 1297861 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
 overflow_before_widen: Potentially overflowing expression
  this->layout.fl_stripe_count.operator __u32() *
  this->layout.fl_object_size.operator __u32() with type unsigned int
  (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used
  in a context that expects an expression of type uint64_t (64 bits, unsigned).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agorgw_rados.h: init non-static member of 'stat_params' in ctor
Danny Al-Gaaf [Wed, 17 Jun 2015 17:40:10 +0000 (19:40 +0200)]
rgw_rados.h: init non-static member of 'stat_params' in ctor

Fix for:

CID 1274323 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member perr is not initialized in
  this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agorgw_rados.h: init non-static member of 'struct Params' in ctor
Danny Al-Gaaf [Wed, 17 Jun 2015 17:37:24 +0000 (19:37 +0200)]
rgw_rados.h: init non-static member of 'struct Params' in ctor

Fix for:

CID 1274321 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member perr is not initialized in
  this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agorbd_replay/Replayer.cc: init non-static members in ctor
Danny Al-Gaaf [Wed, 17 Jun 2015 17:32:00 +0000 (19:32 +0200)]
rbd_replay/Replayer.cc: init non-static members in ctor

Fix for:

CID 1232607 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member m_dump_perf_counters is not
  initialized in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member m_rbd is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member m_ioctx is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member m_latency_multiplier is not
  initialized in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member m_readonly is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoosd/RadosModel.h: init non-static member in ctor
Danny Al-Gaaf [Wed, 17 Jun 2015 12:05:10 +0000 (14:05 +0200)]
osd/RadosModel.h: init non-static member in ctor

Fix for:

CID 1188182 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member rcompletion is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agotest_rgw_admin_meta.cc: init non-static members in ctor
Danny Al-Gaaf [Wed, 17 Jun 2015 10:51:51 +0000 (12:51 +0200)]
test_rgw_admin_meta.cc: init non-static members in ctor

Fix for:

CID 1054872 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member curl_inst is not initialized
  in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member resp_code is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agotest_cors.cc: init non-static members in ctor
Danny Al-Gaaf [Wed, 17 Jun 2015 09:44:39 +0000 (11:44 +0200)]
test_cors.cc: init non-static members in ctor

Fix for:

CID 1019635 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member curl_inst is not initialized
  in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member resp_code is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agotest_rgw_admin_opstate.cc: init non-static members in ctor
Danny Al-Gaaf [Wed, 17 Jun 2015 09:41:51 +0000 (11:41 +0200)]
test_rgw_admin_opstate.cc: init non-static members in ctor

Fix for:

CID 1054871 (#1 of 2): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member curl_inst is not initialized
  in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member resp_code is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agorados/rados.cc: init non-static members in default ctor
Danny Al-Gaaf [Wed, 17 Jun 2015 09:36:52 +0000 (11:36 +0200)]
rados/rados.cc: init non-static members in default ctor

Fix for:

CID 717354 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
 uninit_member: Non-static class member id is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member type is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member off is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member len is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member lg is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member completion is not
  initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomds/MDSMap.cc: fix swapped arguments in CompatSet() ctor call
Danny Al-Gaaf [Wed, 17 Jun 2015 09:11:06 +0000 (11:11 +0200)]
mds/MDSMap.cc: fix swapped arguments in CompatSet() ctor call

Fix for:

CID 1297874 (#1 of 1): Arguments in wrong order (SWAPPED_ARGUMENTS)
 swapped_arguments: The positions of arguments in the constructor
  for CompatSet do not match the ordering of the parameters:
 feature_incompat_base is passed to _ro_compat
 feature_ro_compat_base is passed to _incompat

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agorbd.cc: fix swapped arguments in do_lock_remove() call
Danny Al-Gaaf [Wed, 17 Jun 2015 09:07:32 +0000 (11:07 +0200)]
rbd.cc: fix swapped arguments in do_lock_remove() call

Fix for:

CID 1297875 (#1 of 1): Arguments in wrong order (SWAPPED_ARGUMENTS)
 swapped_arguments: The positions of arguments in the call to
  do_lock_remove do not match the ordering of the parameters:
 lock_cookie is passed to client
 lock_client is passed to cookie

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoErasureCodeJerasure.cc: remove redundant checks before erase()
Danny Al-Gaaf [Tue, 16 Jun 2015 11:45:49 +0000 (13:45 +0200)]
ErasureCodeJerasure.cc: remove redundant checks before erase()

Fix for:

[src/erasure-code/jerasure/ErasureCodeJerasure.cc:254]: (style)
 Redundant checking of STL container element existence before removing it.
[src/erasure-code/jerasure/ErasureCodeJerasure.cc:493]: (style)
 Redundant checking of STL container element existence before removing it.
[src/erasure-code/jerasure/ErasureCodeJerasure.cc:496]: (style)
 Redundant checking of STL container element existence before removing it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomessages/MOSDRepOpReply.h: init some vars of MOSDRepOpReply in ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 10:39:44 +0000 (12:39 +0200)]
messages/MOSDRepOpReply.h: init some vars of MOSDRepOpReply in ctor

Fix for:

CID 1262115 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member map_epoch is not initialized
  in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member ack_type is not initialized
  in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member result is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomessages/MOSDRepOp.h: init some vars of MOSDRepOp in ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 10:38:27 +0000 (12:38 +0200)]
messages/MOSDRepOp.h: init some vars of MOSDRepOp in ctor

Fix for:

CID 1262114 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member map_epoch is not initialized
  in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member acks_wanted is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomds/CDir.cc: init some integer vars of C_IO_Dir_OMAP_Fetched in ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 09:37:54 +0000 (11:37 +0200)]
mds/CDir.cc: init some integer vars of C_IO_Dir_OMAP_Fetched in ctor

Fix for:

CID 1238901 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member ret1 is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member ret2 is not initialized in
  this constructor nor in any functions that it calls.
 uninit_member: Non-static class member ret3 is not initialized in
  this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomds/MDCache.h: init fragment_info_t::bits in ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 09:27:00 +0000 (11:27 +0200)]
mds/MDCache.h: init fragment_info_t::bits in ctor

Fix for:

CID 1188164 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member bits is not initialized
 in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoosd/ReplicatedPG.h: init flushed_version in FlushOp ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 09:11:20 +0000 (11:11 +0200)]
osd/ReplicatedPG.h: init flushed_version in FlushOp ctor

Fix for:

CID 1160851 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member flushed_version is not
 initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomessages/MExportDirFinish.h: init 'last' in default ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 09:07:39 +0000 (11:07 +0200)]
messages/MExportDirFinish.h: init 'last' in default ctor

Fix for:

CID 1138594 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member last is not initialized in
 this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomessages/MMDSOpenInoReply.h: init 'error' in ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 08:49:00 +0000 (10:49 +0200)]
messages/MMDSOpenInoReply.h: init 'error' in ctor

Fix for:

CID 1026812 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member error is not initialized in
 this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomds/MDCache.h: init some members of open_ino_info_t in ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 08:39:14 +0000 (10:39 +0200)]
mds/MDCache.h: init some members of open_ino_info_t in ctor

Fix for:

CID 1026809 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member want_replica is not
  initialized in this constructor nor in any functions that
  it calls.
 uninit_member: Non-static class member want_xlocked is not
  initialized in this constructor nor in any functions that
  it calls.
 uninit_member: Non-static class member tid is not initialized
  in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member pool is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomds/MDCache.cc: init 'default_file_layout' in ctor
Danny Al-Gaaf [Fri, 12 Jun 2015 08:05:59 +0000 (10:05 +0200)]
mds/MDCache.cc: init 'default_file_layout' in ctor

Fix for:

CID 717237 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member field default_file_layout.fl_pg_pool
  is not initialized in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member field default_file_layout.fl_stripe_unit
  is not initialized in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member field default_file_layout.fl_stripe_count
  is not initialized in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member field default_file_layout.fl_object_size
  is not initialized in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member field default_file_layout.fl_cas_hash
  is not initialized in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member field default_file_layout.fl_object_stripe_unit
  is not initialized in this constructor nor in any functions that it calls.
 uninit_member: Non-static class member field default_file_layout.fl_unused
 is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomsg/async/AsyncMessenger.cc: init listen_sd in ctor
Danny Al-Gaaf [Thu, 11 Jun 2015 18:39:46 +0000 (20:39 +0200)]
msg/async/AsyncMessenger.cc: init listen_sd in ctor

Fix for:

CID 1249635 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member listen_sd is not
 initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomsg/async/EventSelect.h: init max_fd in ctor
Danny Al-Gaaf [Thu, 11 Jun 2015 18:32:29 +0000 (20:32 +0200)]
msg/async/EventSelect.h: init max_fd in ctor

Fix for:

CID 1254381 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member max_fd is not initialized
 in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoosd/ECMsgTypes.h: init tid in default ctor
Danny Al-Gaaf [Thu, 11 Jun 2015 18:19:14 +0000 (20:19 +0200)]
osd/ECMsgTypes.h: init tid in default ctor

Fix for:

CID 1188175 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member tid is not initialized in
 this constructor nor in any functions that it calls.

CID 1188174 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
 uninit_member: Non-static class member tid is not initialized in
 this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomon/MonMap.h: fix potential segfault, add assert()
Danny Al-Gaaf [Thu, 11 Jun 2015 18:01:26 +0000 (20:01 +0200)]
mon/MonMap.h: fix potential segfault, add assert()

Fix for:

CID 1297860 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
1. Condition this->mon_addr.count(n), taking true branch
2. negative_return_fn: Function this->get_rank(n) returns a
   negative number. [show details]
3. var_assign: Assigning: signed variable m = get_rank.
4. negative_returns: m is passed to a parameter that cannot be
   negative.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomon/Monitor.cc: fix potential null deref
Danny Al-Gaaf [Thu, 11 Jun 2015 13:39:43 +0000 (15:39 +0200)]
mon/Monitor.cc: fix potential null deref

Access logger object in remove_all_sessions() only if the
object exists.

Fix for:

CID 1225102 (#1 of 1): Dereference before null check (REVERSE_INULL)
 check_after_deref: Null-checking this->logger suggests that it may be
 null, but it has already been dereferenced on all paths leading to the
 check.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agomon/MDSMonitor.cc: fix error handling in 'mds getmap'
Danny Al-Gaaf [Wed, 10 Jun 2015 09:28:01 +0000 (11:28 +0200)]
mon/MDSMonitor.cc: fix error handling in 'mds getmap'

Fix for:

CID 1297889 (#1 of 1): Unused value (UNUSED_VALUE)
 assigned_value: Assigning value -2 to r here, but that
 stored value is overwritten before it can be used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoobjclass/class_api.cc: fix buffer out-of-bounds access
Danny Al-Gaaf [Tue, 9 Jun 2015 14:14:53 +0000 (16:14 +0200)]
objclass/class_api.cc: fix buffer out-of-bounds access

Fix for:

CID 1297864 (#1 of 1): Out-of-bounds access (OVERRUN)
 overrun-buffer-arg: Overrunning array buf of 25 bytes by passing
  it to a function which accesses it at byte offset 25 using
  argument 25.
 cls_gen_rand_base64(): index_parm: Pointer dest is directly
  accessed by indexing it with size.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agorgw/rgw_common.cc: fix char array '\0' termination
Danny Al-Gaaf [Tue, 9 Jun 2015 14:07:02 +0000 (16:07 +0200)]
rgw/rgw_common.cc: fix char array '\0' termination

Fix for:

CID 1297863 (#1 of 1): Out-of-bounds access (OVERRUN)
 overrun-buffer-arg: Overrunning array secret_key_buf of 41 bytes
  by passing it to a function which accesses it at byte offset 41
  using argument key_buf_size (which evaluates to 41).
CID 1297865 (#1 of 1): Out-of-bounds access (OVERRUN)
 overrun-buffer-arg: Overrunning array secret_key_buf of 41
  bytes by passing it to a function which accesses it at byte
  offset 41 using argument 41.

 gen_rand_base64():
  index_parm: Pointer dest is directly accessed by indexing it
  with size.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoclient/Inode.cc: cap_is_valid() fix return value
Danny Al-Gaaf [Tue, 9 Jun 2015 12:26:05 +0000 (14:26 +0200)]
client/Inode.cc: cap_is_valid() fix return value

Inode::cap_is_valid() never returns false in case the
evaluation fails.

Fix for:

CID 1297828 (#1 of 1): Identical code for different branches (IDENTICAL_BRANCHES)
 identical_branches: The same code is executed when the condition
  cap->session->cap_gen <= cap->gen && ceph_clock_now(this->cct) <
  cap->session->cap_ttl is true or false, because the code in the
  if-then branch and after the if statement is identical. Should
  the if statement be removed?
 implicit_else: The code from the above if-then branch is identical
  to the code after the if statement.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoos/FileJournal.cc: fix do-while loop
Danny Al-Gaaf [Tue, 9 Jun 2015 10:32:42 +0000 (12:32 +0200)]
os/FileJournal.cc: fix do-while loop

In case do_submit from libaio fails and returns -EAGAIN the
called continue breaks completely out of the loop since the
loop statement is always false. In this case there is no second
attempt as the code tries. Set the loop condition to true to
fix it.

Fix for:
CID 1297886 (#1 of 1): Structurally dead code (UNREACHABLE)
 continue_in_do_while_false: A continue statement within a do-while
  loop only continues execution of the loop body if the loop
  continuation condition is still true. Since the condition will
  never be true in a "do ... while (false);" loop the continue
  statement has the same effect as a break statement. Did you
  intend execution to continue at the top of the loop?
 do_while_false_condition: This loop will never continue since
  the condition false is never true.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoosd/ECBackend.cc: fix MISSING_BREAK
Danny Al-Gaaf [Tue, 9 Jun 2015 10:10:22 +0000 (12:10 +0200)]
osd/ECBackend.cc: fix MISSING_BREAK

Fix for:
CID 1297854 (#1 of 1): Missing break in switch (MISSING_BREAK)
 unterminated_case: The case for value ECBackend::RecoveryOp::COMPLETE
 is not terminated by a 'break' statement.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoEventEpoll.h: init 'size' in ctor
Danny Al-Gaaf [Mon, 8 Jun 2015 07:54:10 +0000 (09:54 +0200)]
EventEpoll.h: init 'size' in ctor

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoosd/ReplicatedPG.cc: fix error handling for CEPH_OSD_OP_NOTIFY_ACK
Danny Al-Gaaf [Fri, 5 Jun 2015 14:02:57 +0000 (16:02 +0200)]
osd/ReplicatedPG.cc: fix error handling for CEPH_OSD_OP_NOTIFY_ACK

The error handling wasn't correct. In error case call break from
within the for loop doesn't break out of the switch handling as
expected.

Fix for:

CID 1297888 (#1 of 2): Unused value (UNUSED_VALUE)
 assigned_value: Assigning value -22 to result here, but that
 stored value is overwritten before it can be used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agotest/perf_local.cc: init src char array before copy from it
Danny Al-Gaaf [Tue, 2 Jun 2015 11:52:25 +0000 (13:52 +0200)]
test/perf_local.cc: init src char array before copy from it

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoTestRocksdbOptionParse.cc: prefer ++operator for non-primitive iter
Danny Al-Gaaf [Mon, 1 Jun 2015 21:48:28 +0000 (23:48 +0200)]
TestRocksdbOptionParse.cc: prefer ++operator for non-primitive iter

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoceph_erasure_code_benchmark.cc: prefer ++operator for non-primitive iter
Danny Al-Gaaf [Mon, 1 Jun 2015 21:47:24 +0000 (23:47 +0200)]
ceph_erasure_code_benchmark.cc: prefer ++operator for non-primitive iter

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoos/RocksDBStore.cc: prefer ++operator for non-primitive iter
Danny Al-Gaaf [Mon, 1 Jun 2015 21:45:54 +0000 (23:45 +0200)]
os/RocksDBStore.cc: prefer ++operator for non-primitive iter

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agotest/perf_local.cc: fix alloc/dealloc mismatch
Danny Al-Gaaf [Mon, 1 Jun 2015 21:44:16 +0000 (23:44 +0200)]
test/perf_local.cc: fix alloc/dealloc mismatch

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
10 years agoMerge pull request #5260 from ceph/wip-12297-readdir
Yan, Zheng [Fri, 17 Jul 2015 01:14:36 +0000 (09:14 +0800)]
Merge pull request #5260 from ceph/wip-12297-readdir

DNM Client: check dir is still complete after dropping locks in _readdir_cache_cb

10 years agodoc/release-notes: v9.0.2
Sage Weil [Thu, 16 Jul 2015 19:17:44 +0000 (15:17 -0400)]
doc/release-notes: v9.0.2

Signed-off-by: Sage Weil <sage@redhat.com>
10 years agoMerge pull request #5268 from dachary/wip-ceph-port
David Zafman [Thu, 16 Jul 2015 19:17:34 +0000 (12:17 -0700)]
Merge pull request #5268 from dachary/wip-ceph-port

tests: test/cephtool-test-mon.sh uses 7202 7203 and 7204

Reviewed-by: David Zafman <dzafman@redhat.com>
10 years agoMerge pull request #5266 from ceph/wip-ftbfs-cls-cephfs
Loic Dachary [Thu, 16 Jul 2015 19:02:54 +0000 (21:02 +0200)]
Merge pull request #5266 from ceph/wip-ftbfs-cls-cephfs

cls: fix the build on i386

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10 years agotests: test/cephtool-test-mon.sh uses 7202 7203 and 7204 5268/head
Loic Dachary [Thu, 16 Jul 2015 18:32:39 +0000 (20:32 +0200)]
tests: test/cephtool-test-mon.sh uses 7202 7203 and 7204

When running 3 mons, vstart uses ports starting from CEPH_PORT=7202 and
increments to 7203 for the second mon and 7204 for the third. Add a
comment showing the port number. The method for a test to figure out
which port is free is to grep for the port and if nothing matches, use
it. The grep will match 7204 and 7203 and 7202 from the comment and
reduce the chances of someone using 7203 because it was nowhere to be
found in the sources.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
10 years agoMerge branch 'wip-10507'
Joao Eduardo Luis [Thu, 16 Jul 2015 17:40:57 +0000 (18:40 +0100)]
Merge branch 'wip-10507'

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Greg Farnum <gfarnum@redhat.com>
10 years agomessages: MForward: get() message reference
Joao Eduardo Luis [Tue, 14 Jul 2015 15:52:35 +0000 (16:52 +0100)]
messages: MForward: get() message reference

Don't simply put() a reference if it has gone unclaimed without
get()'ing it first. This can cause nefarious consequences for those
users of MForward that do not expect this to happen.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MonOpRequest: dump function as private
Joao Eduardo Luis [Tue, 30 Jun 2015 14:52:08 +0000 (15:52 +0100)]
mon: MonOpRequest: dump function as private

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: services: assert on unexpected op request type
Joao Eduardo Luis [Fri, 26 Jun 2015 09:29:04 +0000 (10:29 +0100)]
mon: services: assert on unexpected op request type

Ensures some type safety by asserting on the request type.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: set op request type during dispatch
Joao Eduardo Luis [Fri, 26 Jun 2015 09:28:36 +0000 (10:28 +0100)]
mon: Monitor: set op request type during dispatch

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MonOpRequest: allow setting the op type
Joao Eduardo Luis [Fri, 26 Jun 2015 09:21:49 +0000 (10:21 +0100)]
mon: MonOpRequest: allow setting the op type

When we introduced the MonOpRequest in the monitor and moved pretty much
every single function receiving messages in their arguments to take op
requests, we basically lost the type safety that was guaranteed from
Monitor::dispatch().

This patch adds an op_type field to the op request, as an easy fix for
this now lacking safety.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: drop PaxoServiceMessage reply functions
Joao Eduardo Luis [Wed, 24 Jun 2015 23:12:33 +0000 (00:12 +0100)]
mon: Monitor: drop PaxoServiceMessage reply functions

The services are now fully using MonOpRequest and should stay that way.
Drop PaxosService-specific reply functions as we want nothing to do with
them :)

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MDSMonitor: use op-related no_reply()
Joao Eduardo Luis [Wed, 24 Jun 2015 22:49:54 +0000 (23:49 +0100)]
mon: MDSMonitor: use op-related no_reply()

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: OSDMonitor: use op requests when sending out full/incrementals
Joao Eduardo Luis [Wed, 24 Jun 2015 22:48:23 +0000 (23:48 +0100)]
mon: OSDMonitor: use op requests when sending out full/incrementals

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: OSDMonitor: move failure code to support op requests
Joao Eduardo Luis [Wed, 24 Jun 2015 16:54:33 +0000 (17:54 +0100)]
mon: OSDMonitor: move failure code to support op requests

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: have op-related no_reply()
Joao Eduardo Luis [Wed, 24 Jun 2015 16:54:05 +0000 (17:54 +0100)]
mon: Monitor: have op-related no_reply()

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MonOpRequest: send_reply() belongs in the Monitor class
Joao Eduardo Luis [Wed, 24 Jun 2015 16:51:56 +0000 (17:51 +0100)]
mon: MonOpRequest: send_reply() belongs in the Monitor class

Op Requests should have no business replying to messages. Besides,
given the Monitor is currently the place to do this, because it is the
one with access to all things that may be required to validate state
(e.g., quorum features), permanently moving this code to the Monitor
class also avoid having duplicate/very similar code in two distinct
places.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: routed requests handling op requests
Joao Eduardo Luis [Wed, 24 Jun 2015 10:50:50 +0000 (11:50 +0100)]
mon: Monitor: routed requests handling op requests

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: forward_request_leader() taking ops instead
Joao Eduardo Luis [Fri, 19 Jun 2015 17:32:37 +0000 (18:32 +0100)]
mon: Monitor: forward_request_leader() taking ops instead

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: drop reply_command(MMonCommand *m,...)
Joao Eduardo Luis [Thu, 18 Jun 2015 15:39:07 +0000 (16:39 +0100)]
mon: Monitor: drop reply_command(MMonCommand *m,...)

Monitor commands are now op requests; always use ops when replying to
commands.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: use op's get_session() instead of getting from connection
Joao Eduardo Luis [Wed, 17 Jun 2015 15:07:37 +0000 (16:07 +0100)]
mon: use op's get_session() instead of getting from connection

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: services: use op-based reply_command()
Joao Eduardo Luis [Wed, 17 Jun 2015 14:54:41 +0000 (15:54 +0100)]
mon: services: use op-based reply_command()

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agocls: fix the build on i386 5266/head
Kefu Chai [Thu, 16 Jul 2015 17:12:03 +0000 (01:12 +0800)]
cls: fix the build on i386

this is a leftover of 0dae022

Signed-off-by: Kefu Chai <kchai@redhat.com>
10 years agomon: Monitor: reply_command() wrapper for ops
Joao Eduardo Luis [Wed, 17 Jun 2015 14:53:12 +0000 (15:53 +0100)]
mon: Monitor: reply_command() wrapper for ops

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Paxos: mark events
Joao Eduardo Luis [Tue, 16 Jun 2015 13:32:46 +0000 (14:32 +0100)]
mon: Paxos: mark events

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: mark events
Joao Eduardo Luis [Wed, 10 Jun 2015 00:55:21 +0000 (01:55 +0100)]
mon: Monitor: mark events

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: PaxosService: mark events
Joao Eduardo Luis [Wed, 10 Jun 2015 00:55:10 +0000 (01:55 +0100)]
mon: PaxosService: mark events

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MonOpRequest: mark events
Joao Eduardo Luis [Wed, 10 Jun 2015 00:54:53 +0000 (01:54 +0100)]
mon: MonOpRequest: mark events

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: services: mark events
Joao Eduardo Luis [Wed, 17 Jun 2015 11:57:08 +0000 (12:57 +0100)]
mon: services: mark events

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: services: use mon->send_reply(op,...) instead
Joao Eduardo Luis [Wed, 17 Jun 2015 11:59:34 +0000 (12:59 +0100)]
mon: services: use mon->send_reply(op,...) instead

We are replying to operations, not messages, so use the appropriate
function to do so (and mark events).

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: PaxosService: use wait_for_.*_ctx() in absence of an op
Joao Eduardo Luis [Thu, 18 Jun 2015 13:55:19 +0000 (14:55 +0100)]
mon: PaxosService: use wait_for_.*_ctx() in absence of an op

The vast majority of cases use PaxosService's wait_for_{state}()
functions to wait on given {state} before waking up a given op-related
callback.  E.g., to reply to a command once a proposal finishes.

However, there are a few cases[1] in which the callback waiting for the
state change does not map to an op.

To maintain compatibility, we were keeping the functions just taking a
callback and no op with the same name as those taking ops (because c++
is amazing that way), but we realized that developers could keep on
using these functions just as before, disregarding the fact that they
likely want to use the version taking the op.  As such, this patch
changes the name of the function taking only the callback, such that it
is used solely when the developer really wants to take just the
callback.

[1] at time of this patch, only three calls were being made that would
use only a callback.  Out of over one hundred calls using ops.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: services: use op-based wait_for_* functions
Joao Eduardo Luis [Wed, 10 Jun 2015 00:52:15 +0000 (01:52 +0100)]
mon: services: use op-based wait_for_* functions

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: PaxosService: have wait_for_* functions requiring an op
Joao Eduardo Luis [Wed, 10 Jun 2015 00:49:23 +0000 (01:49 +0100)]
mon: PaxosService: have wait_for_* functions requiring an op

Basically, so we can mark the op accordinly; we'll leave context-only
functions to maintain compatibility with other users of these functions
that do not use them for op-related callbacks.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Paxos: have wait_for_* functions requiring ops
Joao Eduardo Luis [Fri, 12 Jun 2015 18:20:32 +0000 (19:20 +0100)]
mon: Paxos: have wait_for_* functions requiring ops

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: PGMonitor: implement C_MonOp on op-related callback contexts
Joao Eduardo Luis [Wed, 17 Jun 2015 10:00:19 +0000 (11:00 +0100)]
mon: PGMonitor: implement C_MonOp on op-related callback contexts

These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: OSDMonitor: implement C_MonOp on op-related callback contexts
Joao Eduardo Luis [Wed, 17 Jun 2015 10:00:06 +0000 (11:00 +0100)]
mon: OSDMonitor: implement C_MonOp on op-related callback contexts

These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: LogMonitor: implements C_MonOp on op-related callback contexts
Joao Eduardo Luis [Wed, 17 Jun 2015 09:59:44 +0000 (10:59 +0100)]
mon: LogMonitor: implements C_MonOp on op-related callback contexts

These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: PaxosService: implement C_MonOp on op-related callback contexts
Joao Eduardo Luis [Wed, 10 Jun 2015 00:55:59 +0000 (01:55 +0100)]
mon: PaxosService: implement C_MonOp on op-related callback contexts

These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for
some reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: implement C_MonOp on op-related callback contexts
Joao Eduardo Luis [Mon, 8 Jun 2015 14:04:37 +0000 (15:04 +0100)]
mon: Monitor: implement C_MonOp on op-related callback contexts

These contexts deal with MonOpRequests, and we need to track their life
cycle; use C_MonOp to mark events when the callbacks are woken up for some
reason.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon/mon_types.h: add C_MonOp abstract class
Joao Eduardo Luis [Fri, 5 Jun 2015 15:22:46 +0000 (16:22 +0100)]
mon/mon_types.h: add C_MonOp abstract class

To be used by monitor contexts relying on MonOpRequest, so that we can
easily track the lifespan of an event.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: mark events
Joao Eduardo Luis [Fri, 5 Jun 2015 15:11:57 +0000 (16:11 +0100)]
mon: Monitor: mark events

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MonOpRequest: change service names in mark_*_event()
Joao Eduardo Luis [Wed, 17 Jun 2015 12:00:26 +0000 (13:00 +0100)]
mon: MonOpRequest: change service names in mark_*_event()

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MonOpRequest: add service-specific 'mark event' functions
Joao Eduardo Luis [Wed, 10 Jun 2015 00:53:12 +0000 (01:53 +0100)]
mon: MonOpRequest: add service-specific 'mark event' functions

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MonOpRequest: add mark event functions
Joao Eduardo Luis [Thu, 18 Jun 2015 00:34:10 +0000 (01:34 +0100)]
mon: MonOpRequest: add mark event functions

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: add admin socket command 'ops'
Joao Eduardo Luis [Fri, 5 Jun 2015 15:12:38 +0000 (16:12 +0100)]
mon: Monitor: add admin socket command 'ops'

Dumps currently in-flight ops in the monitor

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: MonOpRequest: add dump function
Joao Eduardo Luis [Thu, 18 Jun 2015 00:35:02 +0000 (01:35 +0100)]
mon: MonOpRequest: add dump function

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
10 years agomon: Monitor: have reply functions for op requests
Joao Eduardo Luis [Fri, 27 Feb 2015 19:06:56 +0000 (19:06 +0000)]
mon: Monitor: have reply functions for op requests

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
10 years agomon: MonOpRequest: add 'send_reply()' function
Joao Eduardo Luis [Fri, 27 Feb 2015 15:58:06 +0000 (15:58 +0000)]
mon: MonOpRequest: add 'send_reply()' function

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
10 years agomon: optracker (3): remove unecessary message variables
Joao Eduardo Luis [Fri, 27 Feb 2015 14:31:23 +0000 (14:31 +0000)]
mon: optracker (3): remove unecessary message variables

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
10 years agomon: optracker (2): remove all unecessary message put()
Joao Eduardo Luis [Wed, 25 Feb 2015 18:40:33 +0000 (18:40 +0000)]
mon: optracker (2): remove all unecessary message put()

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
10 years agomon: optracker (1): support MonOpRequestRef
Joao Eduardo Luis [Thu, 12 Feb 2015 19:41:33 +0000 (19:41 +0000)]
mon: optracker (1): support MonOpRequestRef

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
10 years agoClient: check dir is still complete after dropping locks in _readdir_cache_cb 5260/head
Greg Farnum [Thu, 16 Jul 2015 11:45:05 +0000 (04:45 -0700)]
Client: check dir is still complete after dropping locks in _readdir_cache_cb

We drop the lock when invoking the callback, which means the directory
we're looking at might get dentries trimmed out of memory. Make sure that
hasn't happened after we get the lock back. If it *has* happened, fall back
to requesting the directory contents from the MDS. Update the dirp location
pointers after each entry to facilitate this.
Because this requires we update the dirp->at_cache_name value on every loop,
we rework the updating scheme a bit: to dereference the dn->name before
unlocking, so we know it's filled in; and since we update it on every loop
we don't need to refer to the previous dentry explicitly like we did before.

This should also handle racing file deletes: we get back a trace on
the removed dentry and that will clear the COMPLETE|ORDERED flags.

Fixes #12297

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
10 years agomon: MonOpRequest: have the monitor dealing with operations
Joao Eduardo Luis [Wed, 4 Feb 2015 17:46:28 +0000 (17:46 +0000)]
mon: MonOpRequest: have the monitor dealing with operations

Deal with op requests throughout the monitor state machine, instead of
Messages.  These op requests implement TrackedOp, which will be
trackable by the monitor via a OpTracker.  This will allow us to follow
the operation's life cycle, for the duration of any given operation.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
10 years agomessages: MForward: pack a bufferlist instead of a message
Joao Eduardo Luis [Wed, 11 Feb 2015 14:48:22 +0000 (14:48 +0000)]
messages: MForward: pack a bufferlist instead of a message

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
10 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Thu, 16 Jul 2015 16:03:58 +0000 (12:03 -0400)]
Merge remote-tracking branch 'gh/next'

10 years agoMerge branch 'wip-mon-scrub'
Joao Eduardo Luis [Thu, 16 Jul 2015 15:46:32 +0000 (16:46 +0100)]
Merge branch 'wip-mon-scrub'

Reviewed-by: Sage Weil <sage@redhat.com>
10 years agoMerge branch 'wip-11786'
Joao Eduardo Luis [Thu, 16 Jul 2015 15:44:22 +0000 (16:44 +0100)]
Merge branch 'wip-11786'

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>