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>
Merge branch 'wip-msgr' into next
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>
mon: dump formatted crushmap on report

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
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>
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>
Merge remote-tracking branch 'gh/next'
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>
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>
rbd.py: Fix docstring syntax of list_lockers().

Signed-off-by: Tommi Virtanen <tv@inktank.com>
doc: rst syntax fixes.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
doc: Whitespace cleanup.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
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>
Add TextTable class for table output

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd: use TextTable to implement ls -l

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