check to_remove before setting transaction

currently if you dump transaction for a single rbd write, a transaction
of OMAP_RMKEYS will be listed even if to_remove is empty.

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
Remove dead code in EC LRC plugin

The layer_minimum_to_decode() seems to be dead.

Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
mon: fix `osd crush link` id resolution

A junk value for ID was falling through from
the outer scope.  Rename the outer one to
`osdid` and look up `id` explicitly in crush link.

For a bonus also add an error string for when
link_bucket returns an error (previously
would get plain "Error EINVAL")

Signed-off-by: John Spray <john.spray@redhat.com>
vstart.sh: Fix usage

Signed-off-by: David Zafman <dzafman@redhat.com>
Merge pull request #2806 from zhouyuan/lrc_dead_code

Remove dead code in EC LRC plugin

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
Merge pull request #2589 from majianpeng/bug-fix

Clock: Using clock_gettime instead of gettimeofday in linux os.

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #2808 from ceph/wip-crush-link-id

mon: fix `osd crush link` id resolution

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #2805 from xinxinsh/wip-check-trimmed-pg-log

check to_remove before setting transaction

Reviewed-by: Sage Weil <sage@redhat.com>
rgw/rgw_rest_s3.cc: use !empty() instead of size() > 0

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_rest_swift.cc: use empty() instead of size()

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_rest_user.cc: reduce scope of key_type

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_str_map.cc: remove unused variable

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mon_store_converter.cc: move convert() call out of assert()

The convert() call is changing data. To prevent Heisenbugs
depending in NDEBUG definition (e.g. if debug is off).

Move convert() call out of the assert call and use assert
only on the result value of the call.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
AsyncConnection.cc: prefer ++operator for non-primitive iterators

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
test_rbd_replay.cc: fix va_list parameter handling

Fix for:

[src/test/test_rbd_replay.cc:193]: (portability) Passing NULL after the
last typed argument to a variadic function leads to undefined behaviour.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
SyntheticClient.cc: remove empty lines in if/else blocks

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
SyntheticClient.cc: check return value of getdir()

Check return value as done in all other places. Fix error messages
to print correct function name getdir and not read_dir/readdir since
the error isn't necessarily raised by read_dir().

Fix for:
CID 1219463 (#1 of 1): Unchecked return value (CHECKED_RETURN)
 check_return: Calling getdir without checking return value (as
 is done elsewhere 4 out of 5 times).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
cls_rgw_client.cc: fix potential null pointer deref

Fix for:

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

Add vim line to file.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
arch/neon.c: check result of fread()

Fix for:

CID 1128384 (#1 of 1): Ignoring number of bytes read (CHECKED_RETURN)
 check_return: fread(void * restrict, size_t, size_t, FILE * restrict)
 returns the number of bytes read, but it is ignored.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
rgw/rgw_formats.cc: fix realloc memory leak

Fix handling of realloc. If realloc() fails it returns NULL, assigning
the return value of realloc() directly to the pointer without checking
for the result will lead to a memory leak in error case.

Use a temporary pointer to hold the result of realloc(). In error case
print error and exit, otherwise assign it to the pointer we want to realloc.

Fix also error checks for malloc to fail as soon as malloc fails and
don't try to run realloc again after failed malloc.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>