Commit Graph

25956 Commits

Author SHA1 Message Date
Danny Al-Gaaf
cb91f0fd6e client/Client.cc: fix possible NULL pointer dereference
CID 751332 Dereference null return value (CWE-476)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:56 +02:00
Danny Al-Gaaf
5af2cbfea2 rados.cc: fix leaking of Formatter*
Make sure Formatter* is deleted in error case.

717096 Resource leak (CWE-404) (25 of 25 cases)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:56 +02:00
Danny Al-Gaaf
4b3a7dcb54 client/SyntheticClient.cc: fix another memory leak
Fix memory leak in read_random: call delete[] on buf before
call new[] again in the for-loop.

CID 717071 Resource leak (CWE-404)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:56 +02:00
Danny Al-Gaaf
b9fbc8212e client/SyntheticClient.cc: fix memory leak
Fix memory leak in read_random: call delete[] on buf before
call new[] again in the for-loop.

CID 717070 Resource leak (CWE-404)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:55 +02:00
Danny Al-Gaaf
447f318619 mds/MDCache.cc: fix dereference NULL pointer
Fix possible NULL pointer dereference. Change return value of
CInode::get_dirfrag() to return NULL instead of 0 since it's a
pointer returned.

CID 716991 Dereference null return value (CWE-478)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:55 +02:00
Danny Al-Gaaf
d258df4da3 mds/MDCache.cc: add NULL pointer check
Check for result of get_inode() for NULL before use the pointer.

716990 Dereference null return value (CWE-476)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:55 +02:00
Danny Al-Gaaf
5392e9709e mds/Server.cc: remove dead default in switch
The default switch can't get executed since the switch value
can only have the two values already checked.

CID 716894 Dead default in switch (CWE-561)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:55 +02:00
Danny Al-Gaaf
f56cb98482 osd/OSD.h: add missing unlock of osd_lock
CID 1019560 Missing unlock (CWE-667)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:55 +02:00
Danny Al-Gaaf
b097f65627 rgw/rgw_rest.cc: remove dead and unneeded code
Since origin and meth are already checked to be true there is
no need to check again in s->cio->print() after the initial check.

1019551 Logically dead code (CWE-561)
1019552 Logically dead code (CWE-561)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:55 +02:00
Danny Al-Gaaf
5babc816e0 rbd.cc: fix error handling
Fix undead code. Get error code from write_fd() before check
the result against < 0.

CID 1019550 Logically dead code (CWE-561)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:55 +02:00
Danny Al-Gaaf
4908079c20 rados_sync.cc: remove dead and not needed code
The first if handles all chars < 32, the last 2 if's check for
'\n' (10) and '\r' (13). This code will never be reached and
is already covered. Remove unneeded code.

CID 1019549 Logically dead code (CWE-561)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:55 +02:00
Danny Al-Gaaf
077cdb0487 test/omap_bench.cc: remove dead code
CID 716900 Logically dead code (CWE-561)
CID 716901 Logically dead code (CWE-561)
CID 727968 Logically dead code (CWE-561)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:54 +02:00
Danny Al-Gaaf
0c70e44630 libcephfs/test.cc: add assert for result of ceph_getxattr()
Check result of ceph_getxattr() before pass it as parameter to
strncmp(). Make sure it's not negative.

CID 739411 Argument cannot be negative (CWE-687)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:54 +02:00
Danny Al-Gaaf
8d614665ec rgw/rgw_user.cc: add missing break in switch
Fix switch handling for case KEY_TYPE_SWIFT, add break after the
case to prevent fall through into KEY_TYPE_S3 case.

CID 1019563 Missing break in switch (CWE-484)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:54 +02:00
Danny Al-Gaaf
d9c5b5b7ff client/SyntheticClient.cc: add missing break in switch
Fix switch handling for case SYNCLIENT_MODE_OVERLOAD_OSD_0, add break
after the case to prevent fall through into next case.

CID 716958 Missing break in switch (CWE-484)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:54 +02:00
Danny Al-Gaaf
6e241b97bb ObjectStore.cc: add missing break in switch
Fix switch handling for case OP_SPLIT_COLLECTION2, add break after
the case to prevent fall through into default case.

CID 1019562 Missing break in switch (CWE-484)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 00:02:54 +02:00
John Wilkins
27fb38bb4d doc: Fixed typos. Somehow got a merge error.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-10 14:39:23 -07:00
Sage Weil
65768a6837 mds: be more explicit about path_traverse completion
Coverity turned up

CID 717085 (#1 of 1): Resource leak (RESOURCE_LEAK)
10. leaked_storage: Variable "c" going out of scope leaks the storage it points to.

from _find_ino_dir(), but for all r > 0 cases fin is consumed.  Make this
a bit more explicit by using the helper in the mdr-only case, and by
asserting it is zero in the return 2 path.  Hopefully coverity will notice.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-10 14:30:23 -07:00
Ross Turk
8eaa15f2a6 doc: fix broken link to ceph-deploy in release notes
Signed-off-by: Ross Turk <ross@inktank.com>
2013-05-10 13:53:21 -07:00
John Wilkins
261aaba117 doc: Added entry for the RGW Admin Ops API.
fixes: #5002

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-10 11:30:48 -07:00
Sage Weil
49d22aa649 Merge pull request #271 from dalgaaf/wip-da-sca-cppcheck-v2.1
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-10 10:26:05 -07:00
Danny Al-Gaaf
54e7a6ffe6 libcephfs_jni.cc: reduce scope of ret variable
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:59 +02:00
Danny Al-Gaaf
cd0f461fd5 include/ceph_hash.cc: reduce scope of a var in ceph_str_hash_rjenkins()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:59 +02:00
Danny Al-Gaaf
ad2990c48f include/addr_parsing.c: reduce scope of port_str in safe_cat()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:59 +02:00
Danny Al-Gaaf
cc3376cf91 global/global_init.cc: reduce scope of ret in global_init_daemonize()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
Danny Al-Gaaf
73a10ac9cc crush/builder.c: reduce scope of oldsize in crush_add_bucket()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
Danny Al-Gaaf
e064e67c2b common/safe_io.c: reduce scope of some ssize_t variables
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
Danny Al-Gaaf
8c97e77e57 common/obj_bencher.cc: reduce scope of avg_bandwidth
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
Danny Al-Gaaf
6256d3edee common/ceph_argparse.cc: remove scope of some variables
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
Danny Al-Gaaf
b66b8ddff9 common/admin_socket.cc: remove scope of ret variable in do_accept()
Reduce scope of ret variable and remove usage in one case.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
Danny Al-Gaaf
e7d111406b cls/rbd/cls_rbd.cc: reduce scope of variable rc
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
Danny Al-Gaaf
cdfc4a7ea9 rgw/rgw_op.cc: use empty() instead of size()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
Danny Al-Gaaf
45ffb36bba ceph-filestore-dump.cc: use empty() instead of size()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-10 19:19:58 +02:00
John Wilkins
723062bbdd doc: Updated usage syntax. Added links to hardware and manual OSD remove.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-10 09:37:03 -07:00
Samuel Just
b353da6f68 Merge branch 'wip_pg_res'
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-09 22:24:31 -07:00
Samuel Just
01a07c1ee1 OSD: rename clear_temp to recursive_remove_collection()
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-05-09 22:23:46 -07:00
Samuel Just
f5a60ca226 osd: remove_dir use collection_list_partial
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-05-09 22:23:42 -07:00
Samuel Just
d3dd99b725 PG: no need to wait on DeletingStateRef for flush
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-05-09 17:28:15 -07:00
Samuel Just
0ef9b1e049 osd_internals/pg_removal.rst: update for pg resurrection
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-05-09 17:28:15 -07:00
Samuel Just
90f50c487a OSD: add pg deletion cancelation
DeletingState now allows _create_lock_pg() to attempt to cancel
pg deletion.

PG::init() must mark the PG as backfill iff we stopped a deletion.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-05-09 17:28:15 -07:00
Samuel Just
b274c8a0b2 common/sharedptr_registry.hpp: add remove
remove() can be used to clear an entry before all of its
references are removed.

Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-05-09 17:28:15 -07:00
John Wilkins
c55c6abb60 Merge branch 'master' of https://github.com/ceph/ceph 2013-05-09 12:49:59 -07:00
John Wilkins
270ca6232d doc: Updated doc for connectivity. Updated text with glossary terms.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-09 12:48:59 -07:00
John Wilkins
e4173123d4 doc: Updated disk syntax. Updated text with glossary terms.
fixes: #4933

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-09 12:48:14 -07:00
Sage Weil
c191461636 Merge pull request #267 from ceph/wip-coverity
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-09 12:47:47 -07:00
John Wilkins
af9192871c doc: Added connectivity section. Updated doc with glossary terms.
Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-09 12:46:03 -07:00
John Wilkins
f1b13a1796 doc: Added the non-implemented bit for the gateway to the dev/radosgw TOC.
fixes: #4978

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-09 12:22:21 -07:00
Samuel Just
69b64826b7 OSD: don't rename pg collections, handle PGs in RemoveWQ
Signed-off-by: Samuel Just <sam.just@inktank.com>
2013-05-09 12:20:24 -07:00
John Wilkins
827fd108b6 Merge branch 'master' of https://github.com/ceph/ceph 2013-05-09 12:09:00 -07:00
John Wilkins
fe164e4438 doc: Republishing the admin operations API for the gateway.
fixes: #4978

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
2013-05-09 12:08:28 -07:00