]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
12 years agorbd: Make lock list adapt 'number' of msg (1 lock, 2 locks)
Dan Mick [Fri, 5 Oct 2012 18:12:07 +0000 (11:12 -0700)]
rbd: Make lock list adapt 'number' of msg (1 lock, 2 locks)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: set_conf_param() rewhack:
Dan Mick [Fri, 5 Oct 2012 18:17:44 +0000 (11:17 -0700)]
rbd: set_conf_param() rewhack:

1) comment set_conf_param and the loop that uses it
2) put back error checking for "called with full param list" in macro
3) make all the loop calls consistent
4) add a third arg placeholder to handle lock remove

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoAdd si_t type for large-number "just the suffix, no space"
Dan Mick [Fri, 5 Oct 2012 21:12:16 +0000 (14:12 -0700)]
Add si_t type for large-number "just the suffix, no space"

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoceph-disk-activate, upstart: Use "initctl emit" to start OSDs.
Tommi Virtanen [Mon, 17 Sep 2012 15:55:14 +0000 (08:55 -0700)]
ceph-disk-activate, upstart: Use "initctl emit" to start OSDs.

This avoids an error if the daemon was running already, and is
already being done with the other services.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-create-keys: Refactor to share wait_for_quorum call.
Tommi Virtanen [Thu, 13 Sep 2012 18:34:03 +0000 (11:34 -0700)]
ceph-create-keys: Refactor to share wait_for_quorum call.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoceph-create-keys: Create a bootstrap-osd key too.
Tommi Virtanen [Thu, 13 Sep 2012 21:06:04 +0000 (14:06 -0700)]
ceph-create-keys: Create a bootstrap-osd key too.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoRevert "rbd: gracefully handle extra arguments"
Dan Mick [Fri, 5 Oct 2012 04:13:35 +0000 (21:13 -0700)]
Revert "rbd: gracefully handle extra arguments"

Insufficient understanding of fragile algorithm.  This needs more
thought and I don't want the parsing broken as it is now.

This reverts commit 0d4887932032054d1e2d1ccc832e19c5f7ee7af6.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
12 years agorbd: gracefully handle extra arguments
Dan Mick [Fri, 5 Oct 2012 00:52:05 +0000 (17:52 -0700)]
rbd: gracefully handle extra arguments

Instead of looping across all args, with increments inside the loop,
which can run off the end of the vector, demand that the final
argument parsing have exactly the right number of args, or complain
about the extras and die.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoqa: report success if race is not detected
Josh Durgin [Thu, 4 Oct 2012 23:50:42 +0000 (16:50 -0700)]
qa: report success if race is not detected

This test still verifies that the race is handled correctly if it
occurs, but will no longer clutter test results with spurious failures
when the race is not reproduced.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoqa scripts: Replace cut -f 1 with awk '{print $1;}'
Dan Mick [Thu, 4 Oct 2012 23:56:53 +0000 (16:56 -0700)]
qa scripts: Replace cut -f 1 with awk '{print $1;}'

This is to handle TextTable output, which doesn't use tabs

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agorbd: Use TextTable for showmapped and lock list
Dan Mick [Thu, 4 Oct 2012 22:42:51 +0000 (15:42 -0700)]
rbd: Use TextTable for showmapped and lock list

Also update ocf/rbd.in to handle new output form (spaces)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
12 years agorbd: use TextTable to implement ls -l
Dan Mick [Thu, 4 Oct 2012 21:40:03 +0000 (14:40 -0700)]
rbd: use TextTable to implement ls -l

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agoAdd TextTable class for table output
Dan Mick [Thu, 4 Oct 2012 21:39:16 +0000 (14:39 -0700)]
Add TextTable class for table output

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agolibrbd: fix error handling in get_parent_info
Dan Mick [Thu, 4 Oct 2012 20:53:27 +0000 (13:53 -0700)]
librbd: fix error handling in get_parent_info

Return ENOENT if no parent.
Return error if pool reverse lookup fails.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
12 years agodoc: Whitespace cleanup.
Tommi Virtanen [Thu, 4 Oct 2012 21:51:56 +0000 (14:51 -0700)]
doc: Whitespace cleanup.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agodoc: rst syntax fixes.
Tommi Virtanen [Thu, 4 Oct 2012 21:51:29 +0000 (14:51 -0700)]
doc: rst syntax fixes.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agorbd.py: Fix docstring syntax of list_lockers().
Tommi Virtanen [Thu, 4 Oct 2012 21:43:15 +0000 (14:43 -0700)]
rbd.py: Fix docstring syntax of list_lockers().

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agorbd.py: Docstring syntax.
Tommi Virtanen [Thu, 4 Oct 2012 21:42:36 +0000 (14:42 -0700)]
rbd.py: Docstring syntax.

It's meth for referring to Python class methods:
http://sphinx.pocoo.org/domains.html#python-roles

The links to format() and features() are currently
dead because those methods don't have docstrings.
They'll start working once docstrings are added.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoadmin/build-doc: Use installed Sphinx and its dependencies, when possible.
Sean Channel [Wed, 3 Oct 2012 21:02:55 +0000 (14:02 -0700)]
admin/build-doc: Use installed Sphinx and its dependencies, when possible.

This avoids the delay of installing Sphinx inside the virtualenv;
especially, compiling lxml is slow.

If Sphinx is not installed system-wide (or it's too old), this will
still install a copy inside the virtualenv, to keep working.

Thanks to Sean for the push to make this happen, and testing the
various scenarios; I (Tv) took the liberty of changing the commit to
use venv-python for the manpage build too, avoid the nonstandard
"which" command, be more careful about quoting, and explain more fully
what's going on in the comment.

Closes: https://github.com/ceph/ceph/pull/24
Signed-off-by: Sean Channel <pentabular@gmail.com>
Signed-off-by: Tommi Virtanen <tv@inktank.com>
12 years agoMerge remote-tracking branch 'gh/next'
Sage Weil [Thu, 4 Oct 2012 17:08:46 +0000 (10:08 -0700)]
Merge remote-tracking branch 'gh/next'

12 years agomon: Elector: clean ack set on election start
Joao Eduardo Luis [Thu, 4 Oct 2012 16:34:37 +0000 (17:34 +0100)]
mon: Elector: clean ack set on election start

We should never consider old 'acks' from monitors on a new election. We
usually do it, but we didn't if an election expired, because this code
didn't foresee the possibility of monitors changing ranks in-between
elections -- which doesn't happen if we specify the monmap during the
monitor's mkfs, but may happen when relying on 'mon initial peers'.

Failing to do so triggered an assertion after fixing bug #3252.

Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: Elector: bootstrap on new monmap from elector
Joao Eduardo Luis [Thu, 4 Oct 2012 16:29:22 +0000 (17:29 +0100)]
mon: Elector: bootstrap on new monmap from elector

Whenever we update the monmap we should bootstrap, in order to reset the
monitor's on-going activities and re-probe.

Not doing so contributed to bug #3252, during which we entered an infinite
election cycle. This may only happen though when we rely on 'mon initial
peers'. Specifying a monmap during the monitor's mkfs should not trigger
this bug.

Fixes: #3252
Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: dump formatted crushmap on report
Joao Eduardo Luis [Thu, 4 Oct 2012 16:07:33 +0000 (17:07 +0100)]
mon: dump formatted crushmap on report

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agomon: do not tick() until all paxos instances recover
Sage Weil [Wed, 3 Oct 2012 23:24:18 +0000 (16:24 -0700)]
mon: do not tick() until all paxos instances recover

We cannot propose until they all recover.

Fixes: #3260
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
12 years agoMerge branch 'wip-mds'
Sage Weil [Wed, 3 Oct 2012 17:43:49 +0000 (10:43 -0700)]
Merge branch 'wip-mds'

12 years agoclient: Fix #2215 with cache inval in thread
Sam Lang [Sat, 29 Sep 2012 02:26:16 +0000 (19:26 -0700)]
client: Fix #2215 with cache inval in thread

The client currently deadlocks with kernel buffer cache invalidation
enabled, due to the client lock calling the invalidate callback, which
in turn sends up calls back to the userspace process which try to lock
the same client lock.  The fix is to invoke the invalidate callback in
a separate thread, allowing _release, _flushed, etc. to complete,
unlocking the client lock so that the invalidate callback avoids deadlock
when the up call is made.

We construct a separate work queue (Finisher) that allows scheduling
the invalidate callbacks in a separate thread.  The thread only starts
when the invalidate callback is set.  If no callback is set, the cache
capability reference is decremented inline as before.

Some callers of invalidate_inode_cache (flush and update_inode_file_bits)
don't expect the cache capability to be decremented.  Pass a keep_caps flag to
only decrement the capability ref in the _release case.

Also, we need to make sure the mds is aware that the client has dropped
the cache capability, so we add a call to check_caps in put_cap_ref for the
CEPH_CAP_FILE_CACHE capability.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoclient: Remove unnecessary checkafter parameter
Sam Lang [Fri, 28 Sep 2012 18:48:40 +0000 (11:48 -0700)]
client: Remove unnecessary checkafter parameter

The logic in put_cap_ref doesn't do anything but inode->put_cap_ref
if cap is set to CEPH_CAP_FILE_CACHE, so checkafter isn't needed.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agoceph-fuse: Test for fuse cache issue (#2215)
Sam Lang [Fri, 28 Sep 2012 17:13:51 +0000 (10:13 -0700)]
ceph-fuse: Test for fuse cache issue (#2215)

Signed-off-by: Sam Lang <sam.lang@inktank.com>
12 years agomds: make migrate_stray() specify full path
Sage Weil [Wed, 3 Oct 2012 16:12:40 +0000 (09:12 -0700)]
mds: make migrate_stray() specify full path

The handle_client_rename() check expects a full path rooted in the MDSDIR.
Do so in migrate_stray().

Also, use the committed (not projected) dn linkage; this was a carry-over
from the original switch to this API forever ago, but the current callers
don't need to migrate an uncommitted stray.  This also aligns us with
reintegrate_stray().

Reported-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: update release-process.rst
Sage Weil [Wed, 3 Oct 2012 15:44:52 +0000 (08:44 -0700)]
doc: update release-process.rst

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix stray reintegration check in handle_client_rename
Sage Weil [Wed, 3 Oct 2012 15:23:08 +0000 (08:23 -0700)]
mds: fix stray reintegration check in handle_client_rename

The stray reintegration generates a source path that will be rooted in a
(possibly remote) MDS's MDSDIR; adjust this check accordingly.  This is a
holdover from way back when the straydir was the base of the tree instead
of mdsdir.

Reported-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
12 years agodoc: Added description of ceph release process.
Gary Lowell [Wed, 3 Oct 2012 06:41:35 +0000 (23:41 -0700)]
doc:  Added description of ceph release process.

12 years agoMerge branch 'wip-msgr' into next
Dan Mick [Tue, 2 Oct 2012 23:06:59 +0000 (16:06 -0700)]
Merge branch 'wip-msgr' into next

12 years agoAvoid sign-extension of non-magic Message* values
Dan Mick [Tue, 2 Oct 2012 22:37:42 +0000 (15:37 -0700)]
Avoid sign-extension of non-magic Message* values

Cast to (unsigned long) when checking for magic values, so
real ptrs don't get sign-extended.  Avoids triggering
assert(inq == &local_queue) failure.

Fixes: #3251
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage.weil@inktank.com>
12 years agoqa: try to reproduce a race more times
Josh Durgin [Tue, 2 Oct 2012 19:33:07 +0000 (12:33 -0700)]
qa: try to reproduce a race more times

This was failing occassionally in the nightly runs.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
12 years agomds: Avoid creating unnecessary snaprealm
Yan, Zheng [Tue, 2 Oct 2012 08:55:52 +0000 (16:55 +0800)]
mds: Avoid creating unnecessary snaprealm

When moving directory between snaprealms, we can avoid creating snaprealm
if the directory doesn't has its own snaprealm and directory was created
after both realms' newest snapshot.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Properly re-calculate mdsdir inode's auth bit
Yan, Zheng [Tue, 2 Oct 2012 08:55:51 +0000 (16:55 +0800)]
mds: Properly re-calculate mdsdir inode's auth bit

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Trim non auth subtree directory
Yan, Zheng [Tue, 2 Oct 2012 08:55:50 +0000 (16:55 +0800)]
mds: Trim non auth subtree directory

Trim non auth subtree directory if all its dentries were trimmed
and it's not bound of auth subtree.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Properly update dirty dir fragstat during log replay
Yan, Zheng [Tue, 2 Oct 2012 08:55:49 +0000 (16:55 +0800)]
mds: Properly update dirty dir fragstat during log replay

Dirty dir fragstat is managed by filelock instead of nestlock.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Allow export subtrees in other MDS' stray directory
Yan, Zheng [Tue, 2 Oct 2012 08:55:48 +0000 (16:55 +0800)]
mds: Allow export subtrees in other MDS' stray directory

Stray migration is implemented by rename, it may create auth subtrees
in other MDS' stray directory.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Avoid save unnecessary parent snaprealm
Yan, Zheng [Tue, 2 Oct 2012 08:55:47 +0000 (16:55 +0800)]
mds: Avoid save unnecessary parent snaprealm

We can avoid save parent snaprealm if current_parent_since is greater
than parent snaprealm's newest sequence.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Set metablob.renamed_dirino in do_rename_rollback()
Yan, Zheng [Tue, 2 Oct 2012 08:55:46 +0000 (16:55 +0800)]
mds: Set metablob.renamed_dirino in do_rename_rollback()

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Fix xlock imports
Yan, Zheng [Tue, 2 Oct 2012 08:55:45 +0000 (16:55 +0800)]
mds: Fix xlock imports

Xlock imports and capability imports are uncorrelated, we should call
xlock_import() even there is no capability import.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Allow rename request for stray migration/reintegration
Yan, Zheng [Tue, 2 Oct 2012 08:55:44 +0000 (16:55 +0800)]
mds: Allow rename request for stray migration/reintegration

Allow rename request to modify system directory if it is for stray
migration/reintegration.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Add finish callback to waiting_for_base_ino wait queue
Yan, Zheng [Tue, 2 Oct 2012 08:55:43 +0000 (16:55 +0800)]
mds: Add finish callback to waiting_for_base_ino wait queue

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Consider stopping MDS when finding peer inode
Yan, Zheng [Tue, 2 Oct 2012 08:55:42 +0000 (16:55 +0800)]
mds: Consider stopping MDS when finding peer inode

To migrate strays, the receiving MDS need find stopping MDS' mdsdir

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agomds: Don't drop client request from MDS
Yan, Zheng [Tue, 2 Oct 2012 08:55:41 +0000 (16:55 +0800)]
mds: Don't drop client request from MDS

MDS may send client request for stray migration/reintegration.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
12 years agofilejournal: check lseek() return value on darwin
Sage Weil [Tue, 2 Oct 2012 16:45:00 +0000 (09:45 -0700)]
filejournal: check lseek() return value on darwin

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosdmap, mon: optional dump 'osd tree' in json
Sage Weil [Tue, 2 Oct 2012 16:43:13 +0000 (09:43 -0700)]
osdmap, mon: optional dump 'osd tree' in json

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoclient: Resolves coverity NULL dereference issue
Sam Lang [Tue, 2 Oct 2012 15:43:05 +0000 (10:43 -0500)]
client: Resolves coverity NULL dereference issue

Client::insert_trace() was handling readdir and lssnap replies
assuming that the directory inode was not null.  This commit
checks that the directory inode (returned as part of the trace)
is not null, and invokes insert_readdir_results() for the readdir
and lssnap replies.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
12 years agolibcephfs: destroy cmount on ceph_shutdown()
Sage Weil [Tue, 2 Oct 2012 04:08:27 +0000 (21:08 -0700)]
libcephfs: destroy cmount on ceph_shutdown()

Otherwise this chunk of the heap is leaked.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofilestore: check ioctl SYNC return code
Sage Weil [Tue, 2 Oct 2012 04:02:43 +0000 (21:02 -0700)]
filestore: check ioctl SYNC return code

CID 716860: Unchecked return value (CHECKED_RETURN)
At (22): Calling function "ioctl(int, unsigned long, ...)" without checking return value (as is done elsewhere 30 out of 31 times).

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoobj_bencher: fix leak in error path
Samuel Just [Mon, 1 Oct 2012 22:34:04 +0000 (15:34 -0700)]
obj_bencher: fix leak in error path

CID 717076: Resource leak (RESOURCE_LEAK)At (26): Variable "newContents" going
out of scope leaks the storage it points to.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoPG: assert auth is not end in _compare_scrubmaps
Samuel Just [Mon, 1 Oct 2012 22:27:10 +0000 (15:27 -0700)]
PG: assert auth is not end in _compare_scrubmaps

This should make coverity happy.

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agoFileStore: copy paste error _do_copy_range
Samuel Just [Mon, 1 Oct 2012 22:23:00 +0000 (15:23 -0700)]
FileStore: copy paste error _do_copy_range

CID 728419: Copy-paste error (COPY_PASTE_ERROR)At (2): "srcoff" in "actual !=
(int64_t)srcoff" looks like a copy-paste error. Should it say "dstoff" instead?

Signed-off-by: Samuel Just <sam.just@inktank.com>
12 years agodoc: Removed languages from librados in tech-specific stack diagrams.
John Wilkins [Mon, 1 Oct 2012 21:53:57 +0000 (14:53 -0700)]
doc: Removed languages from librados in tech-specific stack diagrams.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Added stack diagram for rgw. Noted NO MDS. Corrected namespace comment.
John Wilkins [Mon, 1 Oct 2012 21:09:21 +0000 (14:09 -0700)]
doc: Added stack diagram for rgw. Noted NO MDS. Corrected namespace comment.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Removed a setting we can ignore for now.
John Wilkins [Mon, 1 Oct 2012 21:08:34 +0000 (14:08 -0700)]
doc: Removed a setting we can ignore for now.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Minor updates to filesystem settings.
John Wilkins [Mon, 1 Oct 2012 20:51:48 +0000 (13:51 -0700)]
doc: Minor updates to filesystem settings.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Added journal settings to the config TOC.
John Wilkins [Mon, 1 Oct 2012 20:50:55 +0000 (13:50 -0700)]
doc: Added journal settings to the config TOC.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agodoc: Completed a journal configuration reference. Journaler is separate.
John Wilkins [Mon, 1 Oct 2012 20:50:31 +0000 (13:50 -0700)]
doc: Completed a journal configuration reference. Journaler is separate.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
12 years agologrotate: check for executables to avoid cron errors
Tobias Florek [Mon, 1 Oct 2012 16:02:06 +0000 (09:02 -0700)]
logrotate: check for executables to avoid cron errors

Signed-off-by: Tobias Florek <tobias.florek@bytesandbutter.de>
12 years agofilestore: check lseek64 return value
Sage Weil [Mon, 1 Oct 2012 03:50:16 +0000 (20:50 -0700)]
filestore: check lseek64 return value

CID 716862: Other violation (CHECKED_RETURN)
At (3): Calling function "lseek64(to, dstoff, 0)" without checking return value. This library function may fail and return an error code.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofilestore: check ioctl WAIT_SYNC return value
Sage Weil [Mon, 1 Oct 2012 03:48:18 +0000 (20:48 -0700)]
filestore: check ioctl WAIT_SYNC return value

CID 716860: Unchecked return value (CHECKED_RETURN)
At (27): Calling function "ioctl(int, unsigned long, ...)" without checking return value (as is done elsewhere 29 out of 31 times).

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agofilejournal: check lseek64 return value
Sage Weil [Mon, 1 Oct 2012 03:46:37 +0000 (20:46 -0700)]
filejournal: check lseek64 return value

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: fix large pass by value
Sage Weil [Mon, 1 Oct 2012 03:45:15 +0000 (20:45 -0700)]
mon: fix large pass by value

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

CID 717047: 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: Sage Weil <sage@inktank.com>
12 years agomon/PGMap: fix nearfull check
Sage Weil [Mon, 1 Oct 2012 03:44:17 +0000 (20:44 -0700)]
mon/PGMap: fix nearfull check

CID 716881: Copy-paste error (COPY_PASTE_ERROR)
At (2): "full_ratio" in "inc.full_ratio" looks like a copy-paste error. Should it say "nearfull_ratio" instead?

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'next'
Sage Weil [Mon, 1 Oct 2012 03:24:34 +0000 (20:24 -0700)]
Merge branch 'next'

12 years agotest_libcephfs: fix test
Sage Weil [Mon, 1 Oct 2012 03:24:23 +0000 (20:24 -0700)]
test_libcephfs: fix test

Can't close an already-closed dir handle.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibcephfs: fix test workunit
Sage Weil [Mon, 1 Oct 2012 03:54:25 +0000 (20:54 -0700)]
libcephfs: fix test workunit

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoMerge branch 'next'
Sage Weil [Sun, 30 Sep 2012 22:17:33 +0000 (15:17 -0700)]
Merge branch 'next'

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 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 agomon: avoid large pass by value in MForward
Sage Weil [Sat, 29 Sep 2012 08:35:36 +0000 (01:35 -0700)]
mon: avoid large pass by value in MForward

CID 717035: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter caps of type MonCaps (size 144 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix MDSCacheObject pin printer * logic
Sage Weil [Sat, 29 Sep 2012 08:34:26 +0000 (01:34 -0700)]
mds: fix MDSCacheObject pin printer * logic

CID 716895: Logically dead code (DEADCODE)
At (4): Execution cannot reach this statement "(out << "*") << c;".

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomdsmap: init fields in ctor
Sage Weil [Sat, 29 Sep 2012 08:32:08 +0000 (01:32 -0700)]
mdsmap: init fields in ctor

At (2): Non-static class member "session_timeout" is not initialized in this constructor nor in any functions that it calls.
At (4): Non-static class member "session_autoclose" is not initialized in this constructor nor in any functions that it calls.
At (6): Non-static class member "max_file_size" is not initialized in this constructor nor in any functions that it calls.
CID 717238: Uninitialized scalar field (UNINIT_CTOR)
At (8): Non-static class member "max_mds" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix potential overflow
Sage Weil [Sat, 29 Sep 2012 08:30:35 +0000 (01:30 -0700)]
mds: fix potential overflow

CID 717014: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
At (1): Potentially overflowing expression "in->inode.layout.fl_object_size.operator unsigned int() * in->inode.layout.fl_stripe_count.operator unsigned int()" with type "unsigned int" (32 bits, unsigned) 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 either operand to "uint64_t" before performing the multiplication.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: init atid in context
Sage Weil [Sat, 29 Sep 2012 08:29:49 +0000 (01:29 -0700)]
mds: init atid in context

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: init log layout in MDCcahe ctor
Sage Weil [Sat, 29 Sep 2012 08:29:00 +0000 (01:29 -0700)]
mds: init log layout in MDCcahe ctor

CID 717237: Uninitialized scalar field (UNINIT_CTOR)
At (8): Non-static class member field "default_file_layout.fl_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (10): Non-static class member field "default_file_layout.fl_stripe_count" is not initialized in this constructor nor in any functions that it calls.
At (12): Non-static class member field "default_file_layout.fl_object_size" is not initialized in this constructor nor in any functions that it calls.
At (14): Non-static class member field "default_file_layout.fl_cas_hash" is not initialized in this constructor nor in any functions that it calls.
At (16): Non-static class member field "default_file_layout.fl_object_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (18): Non-static class member field "default_file_layout.fl_unused" is not initialized in this constructor nor in any functions that it calls.
At (20): Non-static class member field "default_file_layout.fl_pg_pool" is not initialized in this constructor nor in any functions that it calls.
At (21): Non-static class member field "default_log_layout.fl_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (22): Non-static class member field "default_log_layout.fl_stripe_count" is not initialized in this constructor nor in any functions that it calls.
At (23): Non-static class member field "default_log_layout.fl_object_size" is not initialized in this constructor nor in any functions that it calls.
At (24): Non-static class member field "default_log_layout.fl_cas_hash" is not initialized in this constructor nor in any functions that it calls.
At (25): Non-static class member field "default_log_layout.fl_object_stripe_unit" is not initialized in this constructor nor in any functions that it calls.
At (26): Non-static class member field "default_log_layout.fl_unused" is not initialized in this constructor nor in any functions that it calls.
At (27): Non-static class member field "default_log_layout.fl_pg_pool" is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: simplify get_dirfrag()
Sage Weil [Sat, 29 Sep 2012 08:27:33 +0000 (01:27 -0700)]
mds: simplify get_dirfrag()

Avoid useless have_inode() call.

CID 716996: Dereference null return value (NULL_RETURNS)
At (13): Dereferencing a pointer that might be null "this->get_inode(df.ino, snapid_t(18446744073709551614UL))" when calling "CInode::get_dirfrag(frag_t)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix mlogger shutdown
Sage Weil [Sat, 29 Sep 2012 08:26:05 +0000 (01:26 -0700)]
mds: fix mlogger shutdown

CID 716880: Copy-paste error (COPY_PASTE_ERROR)
At (2): "logger" in "this->logger" looks like a copy-paste error. Should it say "mlogger" instead?

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix leak from get_current_dir_name
Sage Weil [Sat, 29 Sep 2012 08:25:25 +0000 (01:25 -0700)]
mds: fix leak from get_current_dir_name

CID 717086: Resource leak (RESOURCE_LEAK)
At (18): Ignoring storage allocated by "get_current_dir_name()" leaks it.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agolibrbd: simplify math
Sage Weil [Sat, 29 Sep 2012 08:22:19 +0000 (01:22 -0700)]
librbd: simplify math

Bending over backwards hasn't made coveirty happy.  We'll just ignore it
there.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: add assert to lock path
Sage Weil [Sat, 29 Sep 2012 08:17:21 +0000 (01:17 -0700)]
mds: add assert to lock path

This makes coverity happy:

CID 716916: Explicit null dereferenced (FORWARD_NULL)
At (28): Passing null pointer "in" to function "MDSCacheObject::state_test(unsigned int) const", which dereferences it. [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix uninit Dumper fields in ctor
Sage Weil [Sat, 29 Sep 2012 08:16:16 +0000 (01:16 -0700)]
mds: fix uninit Dumper fields in ctor

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix fd leak in dumper
Sage Weil [Sat, 29 Sep 2012 08:14:58 +0000 (01:14 -0700)]
mds: fix fd leak in dumper

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix uninit Capability::last_issue
Sage Weil [Sat, 29 Sep 2012 08:12:53 +0000 (01:12 -0700)]
mds: fix uninit Capability::last_issue

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix uninit field in CInode
Sage Weil [Sat, 29 Sep 2012 08:11:41 +0000 (01:11 -0700)]
mds: fix uninit field in CInode

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: fix typo in rsubdirs warning
Sage Weil [Sat, 29 Sep 2012 08:09:43 +0000 (01:09 -0700)]
mds: fix typo in rsubdirs warning

CID 716879: Copy-paste error (COPY_PASTE_ERROR)
At (2): "rfiles" in "pi->rstat.rfiles" looks like a copy-paste error. Should it say "rsubdirs" instead?

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: init CDir fields
Sage Weil [Sat, 29 Sep 2012 08:08:30 +0000 (01:08 -0700)]
mds: init CDir fields

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomds: avoid useless have_inode() call
Sage Weil [Sat, 29 Sep 2012 08:06:38 +0000 (01:06 -0700)]
mds: avoid useless have_inode() call

CID 716989: Dereference null return value (NULL_RETURNS)
At (83): Dereferencing a pointer that might be null "in" when calling "operator <<(std::ostream &, CInode &)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: pass by value
Sage Weil [Sat, 29 Sep 2012 07:59:54 +0000 (00:59 -0700)]
osd: pass by value

CID 717054: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter recovery_info of type ObjectRecoveryInfo (size 640 bytes) by value.

and more

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: fix coverity NULL warning
Sage Weil [Sat, 29 Sep 2012 07:57:40 +0000 (00:57 -0700)]
osd: fix coverity NULL warning

Session is alwasy set on requests.

CID 717008: Dereference null return value (NULL_RETURNS)
At (34): Dereferencing a pointer that might be null "session" when calling "OSD::Session::del_notif(void *)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: logger is never NULL
Sage Weil [Sat, 29 Sep 2012 07:53:28 +0000 (00:53 -0700)]
osd: logger is never NULL

We set this up in init(), so we don't need to make these dereferences
conditional.

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd/PG: remove redundant NamedState
Sage Weil [Sat, 29 Sep 2012 07:51:08 +0000 (00:51 -0700)]
osd/PG: remove redundant NamedState

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoosd: init all vars in PG::NamedState
Sage Weil [Sat, 29 Sep 2012 07:50:57 +0000 (00:50 -0700)]
osd: init all vars in PG::NamedState

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

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agoceph tool: fix cli test
Sage Weil [Sat, 29 Sep 2012 01:34:26 +0000 (18:34 -0700)]
ceph tool: fix cli test

Signed-off-by: Sage Weil <sage@inktank.com>
12 years agomon: fix uninit var warning in session startup
Sage Weil [Sat, 29 Sep 2012 01:16:49 +0000 (18:16 -0700)]
mon: fix uninit var warning in session startup

This is a false positive; just init the var.

CID 717198: Uninitialized scalar variable (UNINIT)
At (18): Using uninitialized value "auid" when calling "MonCaps::set_auid(uint64_t)". [hide details]

Signed-off-by: Sage Weil <sage@inktank.com>