]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agomon: fix recovered_peon assert
Sage Weil [Sun, 30 Sep 2012 22:12:46 +0000 (15:12 -0700)]
mon: fix recovered_peon assert

Recovered_peon() can get called multiple times for a given machine id.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: debug recovered_{peon,leader}
Sage Weil [Sun, 30 Sep 2012 21:26:52 +0000 (14:26 -0700)]
mon: debug recovered_{peon,leader}

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoFileStore: use fresh vector for calls for listing collection
Samuel Just [Fri, 28 Sep 2012 23:19:56 +0000 (16:19 -0700)]
FileStore: use fresh vector for calls for listing collection

In collection_list_range, use an empty vector to pass into
collection_list_partial.  collection_list_partial stops
listing when the output vector exceeds the specified max.
If this happens before we hit the end of the range,
collection_list_range will spin forever.

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Mike Ryan <mike.ryan@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-osd-caps'
Sage Weil [Thu, 27 Sep 2012 23:34:03 +0000 (16:34 -0700)]
Merge remote-tracking branch 'gh/wip-osd-caps'

Reviewed-by: Sage Weil <sage@inktank.com>
12 years agotest: add more OSDCap unit tests
Josh Durgin [Thu, 27 Sep 2012 22:24:03 +0000 (15:24 -0700)]
test: add more OSDCap unit tests

Check that allow_all() returns false when 'allow *' is not specified.
This would have caught #3228.
Add tests for the output operators as well.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSDCaps: fix allow_all()
Josh Durgin [Thu, 27 Sep 2012 21:44:57 +0000 (14:44 -0700)]
OSDCaps: fix allow_all()

OSD_CAP_ANY is not a mask. Treating it as one made any allowance
equivalent to 'allow *'.

Fixes: #3228
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSDCap: fix output operators for caps
Josh Durgin [Thu, 27 Sep 2012 21:41:24 +0000 (14:41 -0700)]
OSDCap: fix output operators for caps

OSD_CAP_ANY is not a flag, but a value (0xff) that will always
be true when treated as a mask with a non-zero rwxa_t.

Don't duplicate the rwxa_t output operator in the OSDCapSpec output
operator, just use it.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoOSDCap: fix typo in comment
Josh Durgin [Wed, 26 Sep 2012 23:54:37 +0000 (16:54 -0700)]
OSDCap: fix typo in comment

The grammar uses auid, not uid.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: RST cleanup for RPM dev package installs.
John Wilkins [Thu, 27 Sep 2012 22:02:42 +0000 (15:02 -0700)]
doc: RST cleanup for RPM dev package installs.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Removed old ops directory structure and redundant files.
John Wilkins [Thu, 27 Sep 2012 22:02:05 +0000 (15:02 -0700)]
doc: Removed old ops directory structure and redundant files.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agoclient: add WARN_UNUSED_RESULT to client init func
Sam Lang [Mon, 24 Sep 2012 21:09:43 +0000 (14:09 -0700)]
client: add WARN_UNUSED_RESULT to client init func

Adds the gcc attribute (if available) to client init functions to
ensure proper error handling.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Remove unmaintained ldceph.cc from tree
Sam Lang [Mon, 24 Sep 2012 20:37:52 +0000 (13:37 -0700)]
client: Remove unmaintained ldceph.cc from tree

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Mods to fix #3184 for messenger shutdown
Sam Lang [Mon, 24 Sep 2012 20:31:15 +0000 (13:31 -0700)]
client: Mods to fix #3184 for messenger shutdown

This moves the shutdown of the messenger outside of the client
to be able to handle error cases more appropriately.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoRefresh manpages from .rst sources
Dan Mick [Thu, 27 Sep 2012 21:23:42 +0000 (14:23 -0700)]
Refresh manpages from .rst sources

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agomanpage-howto.txt: note that man/Makefile.am may need update too
Dan Mick [Thu, 27 Sep 2012 21:32:28 +0000 (14:32 -0700)]
manpage-howto.txt: note that man/Makefile.am may need update too

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agoAdd howto for changing man pages
Dan Mick [Thu, 27 Sep 2012 21:20:04 +0000 (14:20 -0700)]
Add howto for changing man pages

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agomon: update 'auth' help/usage
Sage Weil [Thu, 27 Sep 2012 21:15:39 +0000 (14:15 -0700)]
mon: update 'auth' help/usage

Fixes: #3227
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agorados: fix man page
Sage Weil [Thu, 27 Sep 2012 21:10:51 +0000 (14:10 -0700)]
rados: fix man page

Default bench IO size if 4MB.

Fixes: 3230
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: fix rpm url (part deux)
Sage Weil [Thu, 27 Sep 2012 21:00:40 +0000 (14:00 -0700)]
doc: fix rpm url (part deux)

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-watch-header-race'
Sage Weil [Thu, 27 Sep 2012 20:37:52 +0000 (13:37 -0700)]
Merge remote-tracking branch 'gh/wip-watch-header-race'

12 years agolibrbd: fix includes for portability
Josh Durgin [Wed, 26 Sep 2012 23:58:32 +0000 (16:58 -0700)]
librbd: fix includes for portability

This needs limits.h for Centos, and the inttypes.h wrapper for FreeBSD.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoMerge remote-tracking branch 'gh/wip-osd'
Sage Weil [Thu, 27 Sep 2012 20:33:45 +0000 (13:33 -0700)]
Merge remote-tracking branch 'gh/wip-osd'

Reviewed-by: Samuel Just <sam.just@inktank.com>
12 years agorgw: check that realloc succeeded
Yehuda Sadeh [Wed, 22 Aug 2012 17:04:59 +0000 (10:04 -0700)]
rgw: check that realloc succeeded

Was missing a test after a realloc.

Backport: argonaut
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
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 agoOSDCap: remove grants added during failed parsing
Josh Durgin [Wed, 26 Sep 2012 20:44:02 +0000 (13:44 -0700)]
OSDCap: remove grants added during failed parsing

Parsing has side effects that must be undone if it fails.  A
capability string like 'allow rwx pool=bar' will add the grant for
'allow rwx' and then fail on the 'pool=bar'. Thus, the client will
effectively have 'rwx' permissions on all pools.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
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>