mds: fix end check in Server::handle_client_readdir()

commit 1174dd3188 (don't retry readdir request after issuing caps)
introduced an bug that wrongly marks 'end' in the the readdir reply.
The code that touches existing dentries re-uses an iterator, and the
iterator is used for checking if readdir is end.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Revert "mon: implement safety interlock for deleting pools"

This reverts commit c993ac9b1fa4037f4cc2674455728ee38a7c978b.

This is too hard to test.  Requiring the pool name twice along with
--yes-i-really-really-mean-it should be sufficient.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: safety interlock for pool deletion

Require that the pool name be passed twice along with an force option
before we irreversibly delete an entire pool of objects.

Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/rbd/copy.sh: use non-deprecated --image-format option

--format is deprecated.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: Monitor: force timecheck cleanup on finish_election()

Fixes: #3854

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Elector: reset the acked leader when the election finishes and we lost

Failure to do so will mean that we will always ack the same leader during
an election started by another monitor.  This had been working so far
because we were still acking the existing leader if he was supposed to
still be the leader; or we were acking a new potentially leader; or we
would eventually fall behind on an election and start a new election
ourselves, thus resetting the previously acked leader.  While this wasn't
something that mattered much until now, the timechecks code stumbled into
this tiny issue and was failing hard at completing a round because there
wouldn't be a reset before the election started -- timechecks are bound
to election epochs.

Fixes: #3854

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: Monitor: rework timecheck code to clarify logic boundaries

The initial timecheck implementation relied on a cleanup function to
clean the state each time we changed epochs (or we got out of quorum),
and we would have to clean up the state in-between rounds in a potentially
confusing way some time down the line.

This patch creates logic boundaries in the code flow, making it clear
where we set up or clear the state when we start or finish an epoch, and
where we set up or clear the round state in-between rounds.  It also
allowed for some other changes in behavior, such as when we set-up the
timecheck event, or when we cancel it.  Despite the slight increase in
size, the mechanism just got more easily understandable than it was before.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
qa: fix mon pool_ops workunit

Use ! for clarity when commands are supposed to fail.
Check a few other cases that should fail, and correct deleting
non-existent pools.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
ceph, rados: update pool delete docs and usage

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
doc: update ceph man page link

It's not the wiki anymore, and the man page needed to be regenerated.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Merge remote-tracking branch 'gh/wip-timecheck

Reviewed-by: Sage Weil <sage@inktank.com>
crush: implement get_children(), get_immediate_parent_id()

Signed-off-by: Sage Weil <sage@inktank.com>
osdmap: implement subtree_is_down() and containing_subtree_is_down()

Implement two methos to see if an entire subtree is down, and if the
containing parent node of type T of a given node is completely down.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: set limit so that we do not an entire down subtree out

Add new configurable 'mon osd down out subtree limit' so that you can
prevent marking out an entire subtree.  If for example an entire rack is
down, do not mark anything in it out.  If less than the whole rack is down,
everything is fair game.

Set the default to 'rack'.

Signed-off-by: Sage Weil <sage@inktank.com>
rgw: fix crash when missing content-type in POST object

Fixes: #3941
This fixes a crash when handling S3 POST request and content type
is not provided.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Merge branch 'wip-osd-down-out'

Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge branch 'wip-pool-delete'

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rgw: fix crash when missing content-type in POST object

Fixes: #3941
This fixes a crash when handling S3 POST request and content type
is not provided.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
doc: Updated to add indep and first n to chooseleaf. Num only used with firstn.

fixes: #3711

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
Merge branch 'master' of https://github.com/ceph/ceph