Commit Graph

36943 Commits

Author SHA1 Message Date
Danny Al-Gaaf
c92d47e5c2 libradosstriper/striping.cc: fix strdup memory leaks
Fix memory leak caused by using std::string to hold result
of strdup call returned from getObjName().

Fix for Coverity issues:

CID 1221525 (#1 of 1): Resource leak (RESOURCE_LEAK)
 leaked_storage: Failing to save or free storage allocated by
 this->getObjName(soid, 0UL) leaks it.

CID 1221526 (1-3 of 3): Resource leak (RESOURCE_LEAK)
 leaked_storage: Failing to save or free storage allocated by
 this->getObjName(soid, *) leaks it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:26 -07:00
Danny Al-Gaaf
be674c5579 test/libradosstriper/striping.cc: fix wrong indentation
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:26 -07:00
Danny Al-Gaaf
4f5d1f48b9 msg/async/Event.cc: use static_cast instead of c-style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:26 -07:00
Danny Al-Gaaf
c952cb9241 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>
2014-10-27 12:44:26 -07:00
Danny Al-Gaaf
1cef8339f7 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>
2014-10-27 12:44:26 -07:00
Danny Al-Gaaf
1bd2abec33 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>
2014-10-27 12:44:26 -07:00
Danny Al-Gaaf
56de4caf35 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>
2014-10-27 12:44:25 -07:00
Danny Al-Gaaf
6c4a08c1aa SyntheticClient.cc: remove empty lines in if/else blocks
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:25 -07:00
Danny Al-Gaaf
6f614fca62 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>
2014-10-27 12:44:25 -07:00
Danny Al-Gaaf
4522a68a2a AsyncConnection.cc: prefer ++operator for non-primitive iterators
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:25 -07:00
Danny Al-Gaaf
0214653baa 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>
2014-10-27 12:44:25 -07:00
Danny Al-Gaaf
2ecd43ba6c test_str_map.cc: remove unused variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:25 -07:00
Danny Al-Gaaf
7f446ea6c1 rgw/rgw_rest_user.cc: reduce scope of key_type
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:25 -07:00
Danny Al-Gaaf
5c7b8c6fab rgw/rgw_rest_swift.cc: use empty() instead of size()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:25 -07:00
Danny Al-Gaaf
17c327fe54 rgw/rgw_rest_s3.cc: use !empty() instead of size() > 0
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-27 12:44:25 -07:00
Sage Weil
1cf9600b0d Merge pull request #2805 from xinxinsh/wip-check-trimmed-pg-log
check to_remove before setting transaction

Reviewed-by: Sage Weil <sage@redhat.com>
2014-10-27 11:04:23 -07:00
Sage Weil
fab71f4bcc Merge pull request #2808 from ceph/wip-crush-link-id
mon: fix `osd crush link` id resolution

Reviewed-by: Sage Weil <sage@redhat.com>
2014-10-27 11:03:53 -07:00
Sage Weil
ba7943e87e 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>
2014-10-27 11:02:30 -07:00
Loic Dachary
b17e24c1e5 Merge pull request #2806 from zhouyuan/lrc_dead_code
Remove dead code in EC LRC plugin

Reviewed-by: Loic Dachary <loic-201408@dachary.org>
2014-10-27 17:06:12 +01:00
David Zafman
84a5c8494c vstart.sh: Fix usage
Signed-off-by: David Zafman <dzafman@redhat.com>
2014-10-27 08:35:37 -07:00
John Spray
a9a218546a 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>
2014-10-27 10:53:32 +00:00
Yuan Zhou
187767022d 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>
2014-10-27 15:10:46 +08:00
xinxin shu
a05dedc644 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>
2014-10-27 05:26:05 +08:00
João Eduardo Luís
6f8524ef76 Merge pull request #2800 from ceph/wip-enoent-race
os/LevelDBStore, RocksDBStore: fix race handling for get store size

Reviewed-by: Joao Eduardo Luis <joao@redhat.com>
2014-10-26 18:58:50 +00:00
Danny Al-Gaaf
f99c5f9a66 rgw/rgw_rados.cc: remove unused variable 'objs'
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:15 +01:00
Danny Al-Gaaf
795456242c osd/ReplicatedPG.cc: use !empty() instead of size() > 0
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
912743cfa9 PGLog.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
ddfdcc30ca common/escape.c: add cppcheck-suppress
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
52ca2b1aab fuse_ll.cc: use reinterpret_cast instead of c-style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
61872e43cf JournalScanner.cc: reduce scope of local variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
94a0ec140f test_disk_bw.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
abb2b8019c objectstore/store_test.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
5e9492c438 TestErasureCodeIsa.cc: reduce scope of 'err' variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
170db6901f TestCrushWrapper.cc: reduce scope of variabele
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
8ebe9e9de5 test_sharedptr_registry.cc: reduce scope of local variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
f2340aa5ca test_shared_cache.cc: reduce scope of local variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:14 +01:00
Danny Al-Gaaf
c01e7d26a7 TestSignalHandlers.cc: add cppcheck-suppress nullPointer
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
10ddfbf028 rgw_rest_user.cc: reduce scope of key_type in several places
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
53f2dad7e0 rbd-replay-prep.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
be66b8250c osd/ReplicatedPG.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
f4de4375b9 osd/PGLog.cc: reduce scope of variable, remove not needed code
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
3d61d8a8ae osd/PG.h: add cppcheck-suppress
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
f4f652d55d os/chain_xattr.cc: reduce scope of some variables
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
ca347b0a9f os/KeyValueStore.cc: reduce scope of variables
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
9d874484b2 os/HashIndex.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
935edd754a mon/OSDMonitor.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
48a1dc360b mds/Server.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
d62b96f39c mds/MDS.cc: remove unused local variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
2f9bf475d0 ErasureCodeLrc.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00
Danny Al-Gaaf
d9abd5352b ErasureCodeIsa.cc: reduce scope of variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-10-26 18:10:13 +01:00