]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agoReplicatedPG: track incoming pushes with perf counters
Mike Ryan [Fri, 21 Sep 2012 16:49:39 +0000 (09:49 -0700)]
ReplicatedPG: track incoming pushes with perf counters

Add perf counters tracking the number of inbound pushes along with the
amount of data in each request.

Signed-off-by: Mike Ryan <mike.ryan@inktank.com>
12 years agoPG: explicitely delay ops on backfill_pos
Samuel Just [Mon, 24 Sep 2012 21:33:17 +0000 (14:33 -0700)]
PG: explicitely delay ops on backfill_pos

Previously, we considered backfill_pos degraded in order to delay
ops since a write to backfill_pos could generate a snap before
backfill_pos, and we assume that (0, backfill_pos) is fully
backfilled.  This is a problem since it's possible that
backfill_pos is a valid object, but not one that currently exists.
For example, it might have been deleted since last_backfill was
last changed.  Instead, we will explicitly delay ops on
backfill_pos in waiting_for_backfill_pos.

This error resulted in #2691 since wait_for_degraded_object also
attempts to recover the object. At this point, the primary would
attempt to recover the object, find that it isn't there, and put
it in the missing set with need=0,0.  Eventually, recover_primary
attempts to recover that object, finds that it has been deleted
in the log, and asserts.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip_backfill_full2'
Sage Weil [Thu, 27 Sep 2012 20:21:23 +0000 (13:21 -0700)]
Merge remote-tracking branch 'gh/wip_backfill_full2'

Conflicts:
src/include/ceph_features.h

12 years agoPG: last_complete might be outside of the log
Samuel Just [Tue, 25 Sep 2012 18:07:07 +0000 (11:07 -0700)]
PG: last_complete might be outside of the log

When we encounter a divergent log entry, we put the
object into the missing set at the prior_version
for the divergent event.  Unfortunately, the event
at prior_version might have been trimmed leaving
the missing set with an item with a need prior to
log_tail.  Thus, last_complete also ends up being
prior to log_tail.

Caused #3208.

There is another bug related to this one: #3213.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agodoc: fix rpm url
Sage Weil [Thu, 27 Sep 2012 20:06:03 +0000 (13:06 -0700)]
doc: fix rpm url

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge tag 'v0.52'
Sage Weil [Thu, 27 Sep 2012 19:54:07 +0000 (12:54 -0700)]
Merge tag 'v0.52'

v0.52

Conflicts:
src/rgw/rgw_rados.cc

12 years agorgw: copy_object should not override ETAG implicitly
Yehuda Sadeh [Wed, 26 Sep 2012 22:43:56 +0000 (15:43 -0700)]
rgw: copy_object should not override ETAG implicitly

When copying an object with new attrs, we still need to
maintain the ETAG.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Conflicts:
src/rgw/rgw_rados.cc

12 years agoFileJournal: correctly check return value of lseek in write_fd
Jim Schutt [Thu, 27 Sep 2012 18:06:29 +0000 (12:06 -0600)]
FileJournal: correctly check return value of lseek in write_fd

Signed-off-by: Jim Schutt <jaschut@sandia.gov>
12 years agodoc: fix injectargs syntax
Josh Durgin [Thu, 27 Sep 2012 17:19:55 +0000 (10:19 -0700)]
doc: fix injectargs syntax

The OSD processes only a single string. The existing example wouldn't
even be passed to the OSD, since it would be interpreted as an option
to the ceph command.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agov0.52 v0.52
Gary Lowell [Thu, 27 Sep 2012 16:26:11 +0000 (16:26 +0000)]
v0.52

12 years agoosd: make 'pg <pgid> revert ...' command idempotent
Sage Weil [Thu, 27 Sep 2012 15:11:58 +0000 (08:11 -0700)]
osd: make 'pg <pgid> revert ...' command idempotent

A failure in the ceph tool -> osd connection may mean this command is sent
twice.  This regularly causes failures in QA.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-rbd-docs'
Sage Weil [Thu, 27 Sep 2012 01:43:34 +0000 (18:43 -0700)]
Merge remote-tracking branch 'gh/wip-rbd-docs'

12 years agoMerge remote-tracking branch 'gh/wip_coverity_osd'
Sage Weil [Thu, 27 Sep 2012 01:43:12 +0000 (18:43 -0700)]
Merge remote-tracking branch 'gh/wip_coverity_osd'

Conflicts:
src/librbd/internal.cc

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'wip-rpm-doc'
Sage Weil [Thu, 27 Sep 2012 01:42:52 +0000 (18:42 -0700)]
Merge branch 'wip-rpm-doc'

12 years agocephfs: Fix breakage of cephfs link
Sam Lang [Thu, 27 Sep 2012 00:50:19 +0000 (17:50 -0700)]
cephfs:  Fix breakage of cephfs link

Add libcommon.la to LDADD for cephfs.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agodoc: update ceph-authtool man page
Josh Durgin [Thu, 27 Sep 2012 00:33:35 +0000 (17:33 -0700)]
doc: update ceph-authtool man page

* document osd capabilities
* fix librados user example
* fix example with outdated syntax (pool= and uid= are not supported)
* ignore auid, object prefix, and class restrictions for now since
  they aren't usable yet
* fix header for keyring file section

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: clarify rbd caching
Josh Durgin [Thu, 27 Sep 2012 00:29:18 +0000 (17:29 -0700)]
doc: clarify rbd caching

* note that it's only for librbd
* put settings in the [client] section for clarity
* fix typo
* re-indent and clarify sentence about clustered fs on top of RBD

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: fix typo in dev layering notes
Josh Durgin [Wed, 26 Sep 2012 00:23:23 +0000 (17:23 -0700)]
doc: fix typo in dev layering notes

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: small fixes to the OpenStack page
Josh Durgin [Wed, 26 Sep 2012 00:21:52 +0000 (17:21 -0700)]
doc: small fixes to the OpenStack page

* 'Ceph common' is not a package name
* config dir is /etc/nova, not /etc/conf
* remove trailing whitespace

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: remove MDS from diagram describing RBD and OpenStack
Josh Durgin [Wed, 26 Sep 2012 00:19:50 +0000 (17:19 -0700)]
doc: remove MDS from diagram describing RBD and OpenStack

The MDS is not used with RBD or librados.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: extend QEMU/RBD docs
Josh Durgin [Wed, 26 Sep 2012 00:08:48 +0000 (17:08 -0700)]
doc: extend QEMU/RBD docs

Describe running a vm from RBD, cache options, and discard support.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: minor fixups to rpm install doc
Sage Weil [Thu, 27 Sep 2012 00:38:24 +0000 (17:38 -0700)]
doc: minor fixups to rpm install doc

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: draft rpm installation
Gary Lowell [Wed, 26 Sep 2012 20:47:29 +0000 (13:47 -0700)]
doc: draft rpm installation

12 years agocephfs: Fix warning - use err instead of errno
Sam Lang [Thu, 27 Sep 2012 00:28:21 +0000 (17:28 -0700)]
cephfs: Fix warning - use err instead of errno

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Fix compile error: bad {0} initializers
Sam Lang [Thu, 27 Sep 2012 00:26:34 +0000 (17:26 -0700)]
client:  Fix compile error: bad {0} initializers

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-3186
Sage Weil [Thu, 27 Sep 2012 00:06:03 +0000 (17:06 -0700)]
Merge remote-tracking branch 'gh/wip-3186

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agorgw: different test for multi object delete
Yehuda Sadeh [Wed, 26 Sep 2012 23:55:15 +0000 (16:55 -0700)]
rgw: different test for multi object delete

We need to check for the existence of the sub-resource.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agoMerge branch 'wip-coverity-client'
Sage Weil [Wed, 26 Sep 2012 23:45:07 +0000 (16:45 -0700)]
Merge branch 'wip-coverity-client'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoclient: Fix coverity UNINIT_CTOR defects
Sam Lang [Wed, 26 Sep 2012 02:32:52 +0000 (19:32 -0700)]
client: Fix coverity UNINIT_CTOR defects

Coverity finds cases where constructors are not initializing
all the members of the struct/class.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Fix coverity 716909 [FORWARD_NULL]
Sam Lang [Wed, 26 Sep 2012 02:11:45 +0000 (19:11 -0700)]
client: Fix coverity 716909 [FORWARD_NULL]

If we fill the request path from the dentry instead of the inode, we
need to use the dentry inode.  This fixes a segfault that would occur
in the case where request->inode is in fact null.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Add asserts for coverity bugs
Sam Lang [Wed, 26 Sep 2012 02:03:49 +0000 (19:03 -0700)]
client: Add asserts for coverity bugs

Coverity 716907-716909 [FORWARD_NULL} doesn't like using a pointer
that might be null.  Assertions check that pointers are valid
before dereferencing.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Fixes coverity defect 716891
Sam Lang [Tue, 25 Sep 2012 16:13:26 +0000 (09:13 -0700)]
client:  Fixes coverity defect 716891

Fix for coverity defect 716891 [DEADCODE] in
Client::encode_dentry_release where the released var is initialized
to 0, but never set, so the pre-emptive release of the dentry
capability (if requested by the drop flag) never happens.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Fixes coverity defect 716890 [DEADCODE]
Sam Lang [Tue, 25 Sep 2012 16:07:00 +0000 (09:07 -0700)]
client:  Fixes coverity defect 716890 [DEADCODE]

In choose_target_mds, the mds number is initialized to 0 and
then a separate target mds number is chosen based on the inode
set in the request.  If the inode isn't set, we drop to choosing
a random mds, but only if the mds number is < 0, which doesn't
happen with the initialize to 0.  This fix initializes the mds
number to -1, ensuring a random mds is chosen.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Coverity fixes for 716841-716844
Sam Lang [Tue, 25 Sep 2012 16:04:02 +0000 (09:04 -0700)]
client: Coverity fixes for 716841-716844

Fixes coverity errors (CHECKED_RETURN) for all calls to
Client::path_walk() where return value wasn't getting checked
in case of error.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agocephfs: Fixes for coverity bugs 716840 and 716970
Sam Lang [Tue, 25 Sep 2012 14:03:57 +0000 (07:03 -0700)]
cephfs:  Fixes for coverity bugs 716840 and 716970

Fixes for two coverity bugs in cephfs.cc.

716840 (CHECKED_RETURN) reported that the return value from
fstat wasn't getting checked.  It now is checked, reports an
error and returns to the caller.

716970 (NEGATIVE_RETURNS) reported that the file descriptor passed
to fstat (*fd) might be negative, which isn't allowed.  The check at
the top that open failed wasn't aborting the function (when *fd < 0),
now it does.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agorgw: copy_object should not override ETAG implicitly
Yehuda Sadeh [Wed, 26 Sep 2012 22:43:56 +0000 (15:43 -0700)]
rgw: copy_object should not override ETAG implicitly

When copying an object with new attrs, we still need to
maintain the ETAG.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
12 years agomds: Move check for empty path lookup to getattr
Sam Lang [Wed, 26 Sep 2012 23:04:50 +0000 (16:04 -0700)]
mds: Move check for empty path lookup to getattr

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoPG, OSD: reject backfills when an OSD is nearly full
Mike Ryan [Fri, 14 Sep 2012 17:31:42 +0000 (10:31 -0700)]
PG, OSD: reject backfills when an OSD is nearly full

Reject backfills when an OSD reaches a configurable full ratio. Retry
backfilling periodically in the hopes that the OSD has become less full.

This changeset introduces two configuration options for dealing with
this: osd_refuse_backfill_full_ratio and osd_backfill_retry_interval.

We also introduce two new state transitions in the PG's Active state.

Signed-off-by: Mike Ryan <mike.ryan@inktank.com>
12 years agotimer: add unsafe callbacks option
Mike Ryan [Fri, 14 Sep 2012 17:30:17 +0000 (10:30 -0700)]
timer: add unsafe callbacks option

Using unsafe callbacks drops the lock between invocations of event
callbacks. It is useful under some circumstances, but the user must take
caution. See the comment in Timer.h for full details.

Signed-off-by: Mike Ryan <mike.ryan@inktank.com>
12 years agodoc: Fixed typo.
John Wilkins [Wed, 26 Sep 2012 18:06:26 +0000 (11:06 -0700)]
doc: Fixed typo.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoJournalingObjectStore: lock journal_lock at top of journal_replay
Samuel Just [Tue, 25 Sep 2012 23:07:23 +0000 (16:07 -0700)]
JournalingObjectStore: lock journal_lock at top of journal_replay

CID 716968: Data race condition (MISSING_LOCK)At (6): Accessing "this->op_seq"
("JournalingObjectStore.op_seq") requires the "Mutex._m" lock.

Doesn't really matter, but this should satisfy coverity.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFlatIndex: terminate dir_name buffer passed to strncpy
Samuel Just [Tue, 25 Sep 2012 22:47:34 +0000 (15:47 -0700)]
FlatIndex: terminate dir_name buffer passed to strncpy

CID 716836: Buffer not null terminated (BUFFER_SIZE_WARNING)At (1): Calling
strncpy with a maximum size argument of 4096 bytes on destination array
"dir_name" of size 4096 bytes might leave the destination string unterminated.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: uninit var in ctor OpSequencer::parent
Samuel Just [Tue, 25 Sep 2012 22:46:44 +0000 (15:46 -0700)]
FileStore: uninit var in ctor OpSequencer::parent

CID 717334: Uninitialized pointer field (UNINIT_CTOR)At (2): Non-static class
member "parent" is not initialized in this constructor nor in any functions
that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: fix omap_store and dbomap leaks in mount
Samuel Just [Tue, 25 Sep 2012 22:35:39 +0000 (15:35 -0700)]
FileStore: fix omap_store and dbomap leaks in mount

CID 717093: Resource leak (RESOURCE_LEAK)At (48): Variable "omap_store" going
out of scope leaks the storage it points to.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: don't leak r in mount
Samuel Just [Tue, 25 Sep 2012 22:29:18 +0000 (15:29 -0700)]
FileStore: don't leak r in mount

ID 717092: Resource leak (RESOURCE_LEAK)At (40): Handle variable "r" going out
of scope leaks the handle.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: fix fd and tmpfd leaks in _detect_fs()
Samuel Just [Tue, 25 Sep 2012 22:22:35 +0000 (15:22 -0700)]
FileStore: fix fd and tmpfd leaks in _detect_fs()

CID 717088: Resource leak (RESOURCE_LEAK)At (11): Handle variable "tmpfd" going
out of scope leaks the handle.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: fix leaked fd and check lseek in _test_fiemap
Samuel Just [Tue, 25 Sep 2012 22:18:13 +0000 (15:18 -0700)]
FileStore: fix leaked fd and check lseek in _test_fiemap

CID 716861: Other violation (CHECKED_RETURN)At (3): Calling function "lseek(fd,
off, 0)" without checking return value. This library function may fail and
return an error code.

CID 717090: Resource leak (RESOURCE_LEAK)At (10): Handle variable "fd" going
out of scope leaks the handle.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: fix filedescriptor leak in mkfs
Samuel Just [Tue, 25 Sep 2012 22:15:58 +0000 (15:15 -0700)]
FileStore: fix filedescriptor leak in mkfs

CID 717091: Resource leak (RESOURCE_LEAK)At (39): Handle variable "fd" going
out of scope leaks the handle.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: fix statfs,fstatfs,fstat ret val checks
Samuel Just [Tue, 25 Sep 2012 22:11:25 +0000 (15:11 -0700)]
FileStore: fix statfs,fstatfs,fstat ret val checks

CID 716863: Other violation (CHECKED_RETURN)At (20): Calling function
"fstat(basedir_fd, &basest)" without checking return value. This library
function may fail and return an error code.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileJournal: uninit var in ctor aio_ctx FileJournal
Samuel Just [Tue, 25 Sep 2012 22:05:09 +0000 (15:05 -0700)]
FileJournal: uninit var in ctor aio_ctx FileJournal

CID 717333: Uninitialized pointer field (UNINIT_CTOR)At (2): Non-static class
member "aio_ctx" is not initialized in this constructor nor in any functions
that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileJournal: uninit var in ctor FileJournal
Samuel Just [Tue, 25 Sep 2012 21:59:07 +0000 (14:59 -0700)]
FileJournal: uninit var in ctor FileJournal

CID 717332: Uninitialized pointer field (UNINIT_CTOR)At (12): Non-static class
member field "iocb.aio_fildes" is not initialized in this constructor nor in
any functions that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileJournal: check return value of lseek in write_fd
Samuel Just [Tue, 25 Sep 2012 21:19:49 +0000 (14:19 -0700)]
FileJournal: check return value of lseek in write_fd

CID 716859: Other violation (CHECKED_RETURN)At (1): Calling function
"lseek64(this->fd, pos, 0)" without checking return value. This library
function may fail and return an error code.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-mon-gv'
Sage Weil [Wed, 26 Sep 2012 16:47:18 +0000 (09:47 -0700)]
Merge remote-tracking branch 'gh/wip-mon-gv'

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Conflicts:
src/include/ceph_features.h

12 years agoclient: Fix for #3184 cfuse segv with no keyring
Sam Lang [Mon, 24 Sep 2012 16:55:25 +0000 (09:55 -0700)]
client: Fix for #3184 cfuse segv with no keyring

Fixes bug #3184 where the ceph-fuse client segfaults if authx is
enabled but no keyring file is present.  This was due to the
client->init() return value not getting checked.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomds: fix ino release on session close
Sage Weil [Sat, 22 Sep 2012 05:20:09 +0000 (22:20 -0700)]
mds: fix ino release on session close

If we project an inode release, we need to follow through, even if for
some reason we decide to keep the session active.  Clear out the session
interval_sets in case that happens.

Fixes: #1677
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-rbd-coverity
Sage Weil [Wed, 26 Sep 2012 05:31:23 +0000 (22:31 -0700)]
Merge remote-tracking branch 'gh/wip-rbd-coverity

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoclient: Put all libcephfs gtest tests into one bin
Sam Lang [Wed, 26 Sep 2012 01:14:12 +0000 (18:14 -0700)]
client: Put all libcephfs gtest tests into one bin

* Modify the Makefile.am to run all gtest libcephfs tests through
a single binary: test_libcephfs.

* Add tests for #2285, #3186, and #2778

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomds: Handle empty relpath from client getattr
Sam Lang [Wed, 26 Sep 2012 00:55:05 +0000 (17:55 -0700)]
mds: Handle empty relpath from client getattr

A bug in the client (see 2b54391) results in an empty relpath on
a lookup request.  This causes a segfault in the mds, because the
getattr logic expects a lookup to have a relpath to place in the
response.  The fix here ensures that lookups include a non-empty
relpath, o.w. aborting the request and returning -EINVAL to the
client.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoFileJournal: fix potential overflow in create()
Samuel Just [Tue, 25 Sep 2012 21:18:19 +0000 (14:18 -0700)]
FileJournal: fix potential overflow in create()

CID 717016: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)At (1):
Potentially overflowing expression "g_conf->osd_max_write_size << 20" with type
"int" (32 bits, signed) is evaluated using 32-bit arithmetic before being used
in a context which expects an expression of type "int64_t" (64 bits, signed).
To avoid overflow, cast the left operand to "int64_t" before performing the
left shift.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileJournal: fix memory leak in _open_file
Samuel Just [Tue, 25 Sep 2012 21:16:52 +0000 (14:16 -0700)]
FileJournal: fix memory leak in _open_file

CID 717087: Resource leak (RESOURCE_LEAK)At (16): Variable "buf" going out of
scope leaks the storage it points to.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agodoc: Added an anchor to enable linking from CRUSH map section.
John Wilkins [Tue, 25 Sep 2012 21:55:54 +0000 (14:55 -0700)]
doc: Added an anchor to enable linking from CRUSH map section.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Clarified descriptions, and improved IA and navigation.
John Wilkins [Tue, 25 Sep 2012 21:55:22 +0000 (14:55 -0700)]
doc: Clarified descriptions, and improved IA and navigation.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoclient: Fix to client filepath initializing
Sam Lang [Tue, 25 Sep 2012 21:48:32 +0000 (14:48 -0700)]
client: Fix to client filepath initializing

The filepath constructor that takes a const char * is missing the
initializer for the encoded member.  This results in uninitialized
memory, so the encoded field is sometimes true, resulting in mds
crashes (see #3186) and client errors with empty components in path
names.  This commit fixes #3186 and #2285.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomon: include auth mon's paxos version on latest gv calculation
Joao Eduardo Luis [Tue, 25 Sep 2012 21:32:29 +0000 (22:32 +0100)]
mon: include auth mon's paxos version on latest gv calculation

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agoDBObjectMap::_get_header fix shadowed var causing dead code
Samuel Just [Tue, 25 Sep 2012 21:13:54 +0000 (14:13 -0700)]
DBObjectMap::_get_header fix shadowed var causing dead code

CID 716897: Logically dead code (DEADCODE)At (5): Execution cannot reach this
statement "return r;".

The outer r was shadowed.  Instead, just return the error code from the
loop.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoosd_types: uninit var in ctor pg_query_t
Samuel Just [Tue, 25 Sep 2012 21:10:11 +0000 (14:10 -0700)]
osd_types: uninit var in ctor pg_query_t

CID 717346: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "epoch_sent" is not initialized in this constructor nor in any functions
that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoosd_types: typo in object_info_t::decode for struct_v==6
Samuel Just [Tue, 25 Sep 2012 21:07:45 +0000 (14:07 -0700)]
osd_types: typo in object_info_t::decode for struct_v==6

hoid.hash is uninitialized, and should not be used to
initialize hoid.hash.

CID 717200: Uninitialized scalar variable (UNINIT)At (9): Using uninitialized
value "hoid.hash" when calling "hobject_t::hobject_t(object_t, std::string
const &, snapid_t, uint64_t, int64_t)".

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoReplicatedPG: add assert to snapset.clones search
Samuel Just [Tue, 25 Sep 2012 20:54:12 +0000 (13:54 -0700)]
ReplicatedPG: add assert to snapset.clones search

CID 716943: Using invalid iterator (INVALIDATE_ITERATOR)At (27): Dereferencing
iterator "p" though it is already past the end of its container.

The assert ensures that p will not be dereferenced if invalid.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: uninit var in ctor Scrubber
Samuel Just [Tue, 25 Sep 2012 20:49:00 +0000 (13:49 -0700)]
PG: uninit var in ctor Scrubber

CID 728001: Uninitialized scalar field (UNINIT_CTOR)At (2): Non-static class
member "epoch_start" is not initialized in this constructor nor in any
functions that it calls.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: big param passed by value, C_PGActivateCommitted
Samuel Just [Tue, 25 Sep 2012 20:47:39 +0000 (13:47 -0700)]
PG: big param passed by value, C_PGActivateCommitted

CID 717052: Big parameter passed by value (PASS_BY_VALUE)At (1): Passing
parameter pi of type entity_inst_t (size 152 bytes) by value.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSDMap: clear setprecision in print_osd_line
Samuel Just [Tue, 25 Sep 2012 20:46:32 +0000 (13:46 -0700)]
OSDMap: clear setprecision in print_osd_line

CID 727987: Not restoring ostream format (STREAM_FORMAT_STATE)At (5): Changing
format state of stream "out" for category precision without later restoring it.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoOSD: big parameter passed by value, send_still_alive
Samuel Just [Tue, 25 Sep 2012 20:45:51 +0000 (13:45 -0700)]
OSD: big parameter passed by value, send_still_alive

CID 717050: Big parameter passed by value (PASS_BY_VALUE)At (1): Passing
parameter i of type entity_inst_t (size 152 bytes) by value.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agolibrados: cleanup: use Mutex::Locker
Sage Weil [Sat, 22 Sep 2012 05:36:41 +0000 (22:36 -0700)]
librados: cleanup: use Mutex::Locker

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrados: protect lookup_pool, get_pool_name with lock
Sage Weil [Sat, 22 Sep 2012 05:36:08 +0000 (22:36 -0700)]
librados: protect lookup_pool, get_pool_name with lock

Fixes: #2525
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: Adjust mydir auth when starting MDS that was stopped cleanly
Yan, Zheng [Tue, 25 Sep 2012 05:46:06 +0000 (13:46 +0800)]
mds: Adjust mydir auth when starting MDS that was stopped cleanly

When starting a MDS that was stopped cleanly, we need manually
adjust mydir's auth. This is because MDS log is empty in this case,
mydir's auth can not be adjusted during log replay.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Fix SessionMap::is_any_state()
Yan, Zheng [Mon, 24 Sep 2012 11:27:08 +0000 (19:27 +0800)]
mds: Fix SessionMap::is_any_state()

is_any_state() should return false when the by_state list is empty.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorbd: fix leak of dir handle in get_rbd_seq
Josh Durgin [Tue, 25 Sep 2012 00:35:09 +0000 (17:35 -0700)]
rbd: fix leak of dir handle in get_rbd_seq

CID 717098: Resource leak (RESOURCE_LEAK)
At (6): Variable "device_dir" going out of scope leaks the storage it
points to.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: fix leak of fd on error when reading an entire file
Josh Durgin [Mon, 24 Sep 2012 22:29:13 +0000 (15:29 -0700)]
rbd: fix leak of fd on error when reading an entire file

CID 717100: Resource leak (RESOURCE_LEAK)
At (6): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: fix leak of fd when importing an image from a file
Josh Durgin [Mon, 24 Sep 2012 22:27:55 +0000 (15:27 -0700)]
rbd: fix leak of fd when importing an image from a file

CID 719579: Resource leak (RESOURCE_LEAK)
At (7): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agosecret: close fd on error
Josh Durgin [Mon, 24 Sep 2012 22:20:14 +0000 (15:20 -0700)]
secret: close fd on error

CID 717079: Resource leak (RESOURCE_LEAK)
At (6): Handle variable "fd" going out of scope leaks the handle.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: always free buffer allocated by md_config_t::_get_val
Josh Durgin [Mon, 24 Sep 2012 22:12:11 +0000 (15:12 -0700)]
librados: always free buffer allocated by md_config_t::_get_val

CID 717083: Resource leak (RESOURCE_LEAK)
At (3): Variable "str" going out of scope leaks the storage it points
to.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: fix use without NULL check in rados_pool_list
Josh Durgin [Mon, 24 Sep 2012 22:03:56 +0000 (15:03 -0700)]
librados: fix use without NULL check in rados_pool_list

CID 716911: Dereference after null check (FORWARD_NULL)
At (5): Passing null pointer "b" to function "strncat(char *, char
const *, size_t)", which dereferences it. (The dereference is assumed
on the basis of the 'nonnull' parameter attribute.)

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: init everything in default IoCtxImpl ctor
Josh Durgin [Mon, 24 Sep 2012 21:56:45 +0000 (14:56 -0700)]
librados: init everything in default IoCtxImpl ctor

CID 717219: Uninitialized pointer field (UNINIT_CTOR)
At (14): Non-static class member "objecter" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: make sure we have a device before trying to unmap
Josh Durgin [Mon, 24 Sep 2012 21:49:27 +0000 (14:49 -0700)]
rbd: make sure we have a device before trying to unmap

CID 717444: Explicit null dereferenced (FORWARD_NULL)
 At (48): Passing null pointer "devpath" to function
"do_kernel_rm(char const *)", which dereferences it.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: fix list for more than 1024 format 2 images
Josh Durgin [Mon, 24 Sep 2012 21:28:40 +0000 (14:28 -0700)]
librbd: fix list for more than 1024 format 2 images

r was not being set in the loop.

CID 716936: Infinite loop (INFINITE_LOOP)
At (1): Top of the loop.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: don't allow order to be more than 64
Josh Durgin [Mon, 24 Sep 2012 21:26:51 +0000 (14:26 -0700)]
librbd: don't allow order to be more than 64

Otherwise it will overflow a uint64_t when shifting.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: use 64-bits to shift order
Josh Durgin [Mon, 24 Sep 2012 21:25:26 +0000 (14:25 -0700)]
librbd: use 64-bits to shift order

Order is never actually this high currently, but it be via librbd.

CID 716937: Overflowed return value (INTEGER_OVERFLOW)
At (3): Overflowed or truncated value (or a value computed from an
overflowed or truncated value) "offset" used as return value.

CID 717012: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "1 << obj_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.

CID 717011: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): 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.

CID 717013: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): 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: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: init cookie in WatchCtx ctor
Josh Durgin [Mon, 24 Sep 2012 20:42:57 +0000 (13:42 -0700)]
librbd: init cookie in WatchCtx ctor

CID 717226: Uninitialized scalar field (UNINIT_CTOR)
At (2): Non-static class member "cookie" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: init m_req in LibrbdWriteback::C_Read ctor
Josh Durgin [Mon, 24 Sep 2012 20:40:50 +0000 (13:40 -0700)]
librbd: init m_req in LibrbdWriteback::C_Read ctor

CID 717225: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "m_req" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: initialize on-disk header in ImageCtx ctor
Josh Durgin [Mon, 24 Sep 2012 20:32:11 +0000 (13:32 -0700)]
librbd: initialize on-disk header in ImageCtx ctor

CID 717224: Uninitialized scalar field (UNINIT_CTOR)
At (26): Non-static class member field "header.snaps" is not
initialized in this constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: init everything in default AioRequest constructors
Josh Durgin [Mon, 24 Sep 2012 20:19:59 +0000 (13:19 -0700)]
librbd: init everything in default AioRequest constructors

CID 717222: Uninitialized pointer field (UNINIT_CTOR)
At (16): Non-static class member "m_hide_enoent" is not initialized
in this constructor nor in any functions that it calls.

CID 717223: Uninitialized scalar field (UNINIT_CTOR)
At (4): Non-static class member "m_has_parent" is not initialized in
this constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: fix coverity warnings for AioCompletions
Josh Durgin [Mon, 24 Sep 2012 19:58:21 +0000 (12:58 -0700)]
librbd: fix coverity warnings for AioCompletions

CID 717220: Uninitialized pointer field (UNINIT_CTOR)
At (4): Non-static class member "aio_type" is not initialized in this
constructor nor in any functions that it calls.

CID 717221: Uninitialized pointer field (UNINIT_CTOR)
At (2): Non-static class member "m_req" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: fix broken link in command reference
Ross Turk [Tue, 25 Sep 2012 19:59:42 +0000 (12:59 -0700)]
doc: fix broken link in command reference

Signed-off-by: Ross Turk <ross@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-2525'
Sage Weil [Tue, 25 Sep 2012 19:39:03 +0000 (12:39 -0700)]
Merge remote-tracking branch 'gh/wip-2525'

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrados: init all variables in ctors
Josh Durgin [Tue, 25 Sep 2012 19:18:38 +0000 (12:18 -0700)]
librados: init all variables in ctors

C_aio_sparse_read_Ack's members are filled in by the only caller
immediately after construction, so make them arguments to the
constructor.

CID 717218: Uninitialized pointer field (UNINIT_CTOR)
At (4): Non-static class member "m" is not initialized in this
constructor nor in any functions that it calls.

WatchContext: these variables are unused, so remove them.

CID 717217: Uninitialized scalar field (UNINIT_CTOR)
At (4): Non-static class member "ver" is not initialized in this
constructor nor in any functions that it calls.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoPG,osd_types,PGMonitor: make backfill state names more descriptive
Samuel Just [Mon, 10 Sep 2012 16:25:07 +0000 (09:25 -0700)]
PG,osd_types,PGMonitor: make backfill state names more descriptive

PG_STATE_BACKFILL->PG_STATE_BACKFILL_WAIT
and
PG_STATE_BACKFILLING->PG_STATE_BACKFILL

backfill -> wait_backfill
backfill+backfilling -> backfill

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: add CEPH_FEATURE for backfill reservation
Samuel Just [Fri, 7 Sep 2012 19:10:24 +0000 (12:10 -0700)]
PG: add CEPH_FEATURE for backfill reservation

Also adds backwards compatibility by just post_event-ing
the RemoteBackfillReserved() rather than sending the
message to an older replica.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agodoc/: added documentation for backfill_reservation
Samuel Just [Fri, 7 Sep 2012 16:22:10 +0000 (09:22 -0700)]
doc/: added documentation for backfill_reservation

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoosd/: add PG_STATE_BACKFILLING
Samuel Just [Fri, 7 Sep 2012 01:02:08 +0000 (18:02 -0700)]
osd/: add PG_STATE_BACKFILLING

PG_STATE_BACKFILLING is set when the pg enters the Backfilling state.
That is, +backfilling indicates that the pg has obtained its
reservations and is now actively backfilling.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoosd/: add backfill reservations
Samuel Just [Thu, 6 Sep 2012 22:11:57 +0000 (15:11 -0700)]
osd/: add backfill reservations

Previously, a new osd would be bombarded by backfills from many osds
simultaneously, resulting in excessively high load.  Instead, we
want to limit the number of backfills coming into and going out
from a single osd.

To that end, each OSDService now has two AsyncReserver instances: one
for backfills going from the osd (local_reserver) and one for backfills
going to the osd (remote_reserver).  For a primary to initiate a
backfill, it must first obtain a reservation from its own
local_reserver.  Then, it must obtain a reservation from the backfill
target's remote_reserver via a MBackfillReserve message. This process is
managed by substates of Active and ReplicaActive (see the changes in
PG.h).  The reservations are dropped either on the Backfilled event,
which is sent on the primary before calling recovery_complete and on the
replica on receipt of the BackfillComplete progress message), or upon
leaving Active or ReplicaActive.

It's important that we always grab the local reservation before the
remote reservation in order to prevent a circular dependency.

Signed-off-by: Samuel Just <sam.just@inktank.com>