Commit Graph

26131 Commits

Author SHA1 Message Date
Sage Weil
29d8ec4ecd Merge pull request #285 from dalgaaf/wip-da-CID-fixes-2-v3
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-14 10:30:20 -07:00
Danny Al-Gaaf
e69257eaee rgw/rgw_user.cc: fix possible NULL pointer dereference
CID 1019559 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "usr" to function
  "RGWUser::get_store()", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 19:20:29 +02:00
Danny Al-Gaaf
d69290219d mds/Server.cc: fix possible NULL pointer dereference
Assert if straydn is NULL.

CID 1019554 (#2 of 2): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "straydn" to function
  "MDSCacheObject::is_auth() const", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 19:15:23 +02:00
Danny Al-Gaaf
fb222a0a1c mds/Server.cc: fix possible NULL pointer dereference
Assert of straydn is NULL here.

CID 1019558 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "straydn" to function
  "CDentry::get_dir() const", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 19:07:29 +02:00
Danny Al-Gaaf
c87788b69b mds/Server.cc: fix possible NULL pointer dereference
Assert if destdn == NULL.

CID 1019557 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "destdn" to function
  "CDentry::get_dir() const", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 19:02:20 +02:00
Danny Al-Gaaf
088455f85e librados/AioCompletionImpl.h: add missing Lock
Add missing Lock around code changing AioCompletionImpl::rval/ack and safe
in C_AioCompleteAndSafe::finish().

CID 1019565 (#1 of 1): Data race condition (MISSING_LOCK)
  missing_lock: Accessing "this->c->rval" ("_ZN8librados17AioCompletionImplE.rval")
  requires the "Mutex._m" lock.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:50:09 +02:00
Danny Al-Gaaf
8a52350dd8 src/dupstore.cc: check return value of list_collections()
CID 1019545 (#1 of 1): Unchecked return value (CHECKED_RETURN)
  check_return: Calling function "ObjectStore::list_collections
  (std::vector<coll_t, std::allocator<coll_t> > &)" without
  checking return value (as is done elsewhere 5 out of 6 times).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:44:06 +02:00
Danny Al-Gaaf
70a4a971f4 mds/Server.cc: fix possible NULL pointer dereference
CID 1019555 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "in" to function
  "Server::_need_force_journal(CInode *, bool)", which dereferences it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:43:37 +02:00
Danny Al-Gaaf
21489acffe src/rbd.cc: use 64-bits to shift 'order'
CID 1019568 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
  overflow_before_widen: Potentially overflowing expression "1 << *order" with
  type "int" (32 bits, signed) is evaluated using 32-bit arithmetic before being
  used in a context which expects an expression of type "uint64_t" (64 bits,
  unsigned). To avoid overflow, cast the left operand to "uint64_t" before
  performing the left shift.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:32 +02:00
Danny Al-Gaaf
3e44682519 mon/Monitor.cc: init 'timecheck_acks' with '0' in constructor
CID 1019623 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "timecheck_acks" is not
  initialized in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:31 +02:00
Danny Al-Gaaf
528ec3533a mon/Monitor.h: init 'crc' in constructor with '0'
CID 1019624 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "crc" is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:31 +02:00
Danny Al-Gaaf
988363094a mon/QuorumService.h: remove unused QuorumService::flags
CID 1019626 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
  uninit_member: Non-static class member "flags" is not initialized
  in this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:31 +02:00
Danny Al-Gaaf
8df55e0a8b test/test_cors.cc: initialize key_type in constructor
CID 1019635 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
  uninit_member: Non-static class member "kt" is not initialized in
  this constructor nor in any functions that it calls.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:31 +02:00
Danny Al-Gaaf
eac545e12c tools/ceph.cc: cleanup memory allocated for 'buf'
CID 717123 (#1-2 of 2): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "buf" going out of scope leaks the storage
  it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:31 +02:00
Danny Al-Gaaf
c3c140b38c tools/ceph.cc: close file descriptor in error case
CID 717122 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_handle: Handle variable "fd" going out of scope leaks
  the handle.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:31 +02:00
Danny Al-Gaaf
043ea2ce9b tools/ceph.cc: close file descriptor in error case
CID 717121 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_handle: Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:31 +02:00
Danny Al-Gaaf
36028916c4 test_filejournal.cc: cleanup memory in destructor
CID 716885 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
  alloc_new: Allocating memory by calling "new C_SafeCond(&this->lock,
    &this->cond, &this->done, NULL)".
  ctor_dtor_leak: The constructor allocates field "c" of "C_Sync" but
    the destructor and whatever functions it calls do not free it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:30 +02:00
Danny Al-Gaaf
7ea44ee06e librbd/test_librbd.cc: free memory in test_list_children()
CID 719581 (#7 of 7): Resource leak (RESOURCE_LEAK)
CID 719581 (#6 of 7): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "pools" going out of scope leaks the
  storage it points to.
CID 719582 (#6-7 of 7): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "children" going out of scope leaks
  the storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:30 +02:00
Danny Al-Gaaf
3c285c44bd scratchtool.c: cleanup rados_t on error
Make sure rados_shutdown() get called also in error case.

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

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:30 +02:00
Danny Al-Gaaf
cab8e9bfcd test/kv_store_bench.cc: fix resource leak
CID 727984 (#5 of 5): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "cb_args" going out of scope leaks the storage
  it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:30 +02:00
Danny Al-Gaaf
d8cb7dfc22 filestore/test_idempotent_sequence.cc: fix FileStore leaks
CID 717107 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "store" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:30 +02:00
Danny Al-Gaaf
349cfb41d0 ceph-filestore-dump.cc: cleanup on error case
CID 1019589 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "t" going out of scope leaks the
  storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:30 +02:00
Danny Al-Gaaf
df4c099af4 ceph-filestore-dump.cc: cleanup resource in error case
CID 1019590 (#1 of 1): Resource leak (RESOURCE_LEAK):
 leaked_storage: Variable "rmt" going out of scope leaks the
 storage it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-14 18:39:30 +02:00
Gary Lowell
9382379cc6 v0.62 2013-05-14 09:13:07 -07:00
Sage Weil
c5deb5dbe2 doc/release-notes: v0.61.2
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-13 20:48:20 -07:00
Sage Weil
45e19510a3 Merge remote-tracking branch 'gh/next' 2013-05-13 17:17:43 -07:00
Sage Weil
393140e77d Merge pull request #281 from ceph/wip-rbd-rm-enoent
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-13 16:07:55 -07:00
Sage Weil
4bb4063345 ceph_test_libcephfs: parse environment
Lets you use CEPH_ARGS to get output from the tester.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-13 16:06:33 -07:00
Samuel Just
f24b8fb976 PG: fix some brace styling
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
2013-05-13 15:56:11 -07:00
Samuel Just
72bf5f4813 PG: subset_last_update must be at least log.tail
Fixes: 5020
Backport: bobtail, cuttlefish
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
2013-05-13 15:55:34 -07:00
Josh Durgin
395a775a8c SimpleThrottle: fix -ENOENT checking
The condition was reversed. Rewrite it so it's clear that we're
ignoring -ENOENT only when m_ignore_enoent is set.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-13 14:49:46 -07:00
David Zafman
88af2b0f7b Replace mis-named mon config variables using mon_osd_min_down_reports/mon_osd_min_down_reporters
Signed-off-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-13 13:24:58 -07:00
Sage Weil
225fefe5e7 ceph-disk: add '[un]suppress-activate <dev>' command
It is often useful to prepare but not activate a device, for example when
preparing a bunch of spare disks.  This marks a device as 'do not
activate' so that it can be prepared without activating.

Fixes: #3255
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-13 12:35:32 -07:00
Sage Weil
de4678fa78 Merge pull request #280 from ceph/wip-4996
Reviewed-by: Joao Luis <joao.luis@inktank.com>
2013-05-13 12:31:31 -07:00
Sage Weil
5c305d6304 mon: fix validatation of mds ids in mon commands
Fixes: #4996
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-13 11:49:27 -07:00
Sage Weil
1104116309 Merge pull request #278 from ceph/wip-4974
Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-13 11:39:36 -07:00
Joao Eduardo Luis
ba05b16ee2 mon: Monitor: tolerate GV duplicates during conversion
Fixes: #4974

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
2013-05-13 11:37:36 -07:00
Sage Weil
6db072d4a9 libcephfs: add ceph_conf_parse_env()
This exists in the librados API.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-13 10:16:32 -07:00
Sage Weil
9ec77ebbd2 ceph_test_libcephfs: fix xattr test
This broke in 0c70e44630.

Fixes: #5030
Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-13 10:16:21 -07:00
Samuel Just
9bb58b2ac9 OSD: We need to wait on CLEARING_DIR, not DELETED_DIR
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
2013-05-13 09:52:23 -07:00
athanatos
c24ffc16dd Merge pull request #274 from dalgaaf/wip-da-fix-osd_h
osd/OSD.h: fix try_stop_deletion

Reviewed-by: Sam Just <sam.just@inktank.com>
2013-05-13 09:42:26 -07:00
Josh Durgin
db29f49f9e Merge pull request #275 from ceph/wip-rbd-read-from-replica
Reviewed-by: Sage Weil <sage.weil@inktank.com>
2013-05-12 23:01:14 -07:00
Josh Durgin
13ae13a906 librbd: add options to enable balanced or localized reads for snapshots
Since snapshots never change, it's safe to read from replicas for them.
A common use for this would be reading from a parent snapshot shared by
many clones.

Convert LibrbdWriteback and AioRead to use the ObjectOperation api
so we can set flags. Fortunately the external wrapper holds no data,
so its lifecycle doesn't need to be managed.

Include a simple workunit that sets the flags in various combinations
and looks for their presence in the logs from 'rbd export'.

Fixes: #3064
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-12 19:31:22 -07:00
Josh Durgin
0c7414b1de ReplicatedPG: send -EAGAIN for both balanced and localized reads
This logic for localized reads applies to balanced reads too.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-12 19:31:22 -07:00
Josh Durgin
4ddaea70b2 librados: add per-ObjectOperation flags for balanced and localized reads
These need to apply to the entire ObjectOperation, not just a subop,
so use a new enum and a new aio_operate() call that takes them.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-12 19:31:22 -07:00
Josh Durgin
442f0588a5 librados: add sparse_read() to the C++ bindings for an ObjectOperation
This will allow it to be used with general aio_operate() so we don't have
to add new versions of each operation when we want to add new per-op
arguments, like flags, namespaces, or explicit snapshot contexts/ids.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-12 19:31:22 -07:00
Josh Durgin
d5193460bf Objecter, librados: use only ObjectOperation form of sparse_read internally
This will be used when exposing an ObjectOperation version of sparse_read()
to the librados user, and there's no reason to duplicate code for creating
and handling it. Add a wrapper Context for handling the lifecycle of the
::ObjectOperation.

This cleans up the synchronous version of sparse_read quite a bit by
using the general operate_read() instead of duplicating decoding and
a bunch of sync boilerplate.

Move handling the decoding of a sparse_read into the Objecter, with
the rest of the decoding of rados operations. librados shouldn't be
the only user of the Objecter that can understand sparse_reads.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-12 19:31:22 -07:00
Josh Durgin
ed76824c47 Objecter: fix error handling for decoding stat
r is just a local variable, changing it has no effect.
Set the per-operation return value if provided when a decoding
error occurs.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-05-12 19:26:19 -07:00
Sage Weil
82211f2197 qa: rsync test: exclude /usr/local
Some plana have non-world-readable crap in /usr/local/samba.  Avoid
/usr/local entirely for that and any similar landmines.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-05-11 17:36:13 -07:00
Danny Al-Gaaf
459c731145 osd/OSD.h: fix try_stop_deletion
Fix try_stop_deletion(): The comment above the while loop says "If we are
in DELETING_DIR or DELETED_DIR", but the while loop checks for DELETING_DIR
twice. Change one check to DELETED_DIR otherwise on state get missed.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-11 19:58:43 +02:00