test: switch the cls_replica_log tests to use a test fixture

Instead of the silly macros.

Signed-off-by: Greg Farnum <greg@inktank.com>
rgw: grab the old mtime when doing a user metadata put

We're about to use this to enable (ick) a timestamp-based update
decision tree, to help in resolving disastrous double-active conflicts.

Signed-off-by: Greg Farnum <greg@inktank.com>
cls/rgw/cls_rgw.cc: init start_key_added with false

Fix for coverity issue:

CID 1049231 (#1 of 1): Uninitialized scalar variable (UNINIT)
  uninit_use: Using uninitialized value "start_key_added".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_version.cc: fix ressource leak

CID 1049220 (#18 of 18): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_version.cc: fix another ressource leak

CID 1049219 (#17 of 17): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "op" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_version.cc: fix resource leak, delete before new()

CID 1049217 (#1 of 1): Resource leak (RESOURCE_LEAK)
  overwrite_var: Overwriting "op" in "op = new_op()" leaks
  the storage that "op" points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_version.cc: fix resource leak, delete before new()

Fix some more cases where resource wasn't deleted/freed before
call new().

CID 1049216 (#1-9 of 9): Resource leak (RESOURCE_LEAK)
  overwrite_var: Overwriting "op" in "op = new_op()" leaks
  the storage that "op" points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_statelog.cc: fix resource leak, delete rop at end of function

CID 1049215 (#12 of 12): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_statelog.cc: fix resource leak, delete op at end of function

CID 1049214 (#13 of 13): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "op" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_cls_statelog.cc: fix resource leak, delete 'rop' at end of function

CID 1049213 (#3 of 3): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "rop" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
configure.ac:  Remove -rc suffix from the configure version number.

Remove the rc suffix since RPM complains about.  For rc release
builds the "rc" in the git describe string is suffcient for
everyhting but RPM.  For rc release builds (i.e. not gitbuilder)
add a flag to the spec file.

Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
mon: OSDMonitor: fix a bug introduced on 97462a32

Fixes: #5737
Backport: cuttlefish

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
test: test_store_tool: global init before using LevelDBStore

Fixes a segfault

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
mon/Monitor.cc: init scrub_version with 0 in constructor

CID 1019623 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "scrub_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>
os/ObjectStore.cc: don't fallthrough after OP_OMAP_RMKEYRANGE

CID 1054829 (#1 of 1): Missing break in switch (MISSING_BREAK)
  unterminated_case: This case (value 37) is not terminated by a
  'break' statement.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_metadata.cc: fix possible null dereferencing

CID 1054827 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "objv_tracker->read_version"
  to function "obj_version::operator =(obj_version const &)", which
  dereferences it.

Moved affected 2 cases into the block checking for objv_tracker

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_metadata.h: init cur_shard in LogListCtx with 0

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

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mon/OSDMonitor: search for latest full osdmap if record version is missing

In 97462a3213e5e15812c79afc0f54d697b6c498b1 we tried to search for a
recent full osdmap but were looking at the wrong key.  If full_0 was
present we could record that the latest full map was last_committed even
though it wasn't present.  This is fixed in 76cd7ac1c, but we need to
compensate for when get_version_latest_full() gives us a back version
number by repeating the search.

Fixes: #5737
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph.in/ceph_argparse.py: move find_cmd_target() to ceph_argparse.py

Signed-off-by: Dan Mick <dan.mick@inktank.com>
MonCommands.h: osd pool delete "rw" perms, osd pool set no longer exp

Signed-off-by: Dan Mick <dan.mick@inktank.com>