PG looking-up/checking does not need to hold the osd_lock since it is being protected by pg_map_lock, remove the assertion.

Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
Move the sched_scrub to a new tick timer which does not need to hold the osd_lock.

Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
Revert "client: invalidate kernel dentries one by one"

This reverts commit 491da5173fc33fec944865f0e2e9a506ec71fc5b.

Since 3.18 kernel, d_invalidate() unhash dentry even when it's
in use. If dentry of process' working directory is invalidated,
calling getcwd(3) will return -ENOENT.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
client: cleanup client callback registration

Signed-off-by: Yan, Zheng <zyan@redhat.com>
client: use remount to trim kernel dcache

when remounting a file system, linux kernel trims all unused dentry
in the file system.

Fixes: #10277
Signed-off-by: Yan, Zheng <zyan@redhat.com>
SimpleMessenger: Retry binding on addresses if binding fails

If binding on a IP-Address fails, delay and retry again.

This happens mainly on IPv6 deployments. Due to DAD (Duplicate Address Detection)
or SLAAC it can be that IPv6 is not yet available when the daemons start.

Monitor daemons try to bind on a static IPv6 address and that might not be available
yet and that causes the monitor not to start.

Fixes: #10029
Merge pull request #3121 from ceph/wip-10277

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
mon: make 'ceph -s' show pg state counts in reverse descending order

Because these are in an unordered_map we print this is random order.
Instead sort descending by count.

Signed-off-by: Sage Weil <sage@redhat.com>
install-deps.sh: do not require sudo when root

If the user is root, do not use sudo. The sudo package is not installed
by default on centos by default and when building from script it may be
that root is running install-deps.sh on a freshly install distribution.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: run-make-check.sh install jq

jq is useful to parse json from the command line. It is however not
packaged for all supported distributions (precise has it in the backport
repository which is usually not active) and cannot be conveniently added
to debian/control because it targets all distributions and has no
conditionals.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: docker images must use install-deps.sh

The dockerfiles must run install-deps.sh instead of duplicating the
package list that is found in ceph.spec.in and debian/control.

A directory is created for each os_type and provided as a context for
docker build to use. The former $os_type.dockerfile is moved into
$os_type/Dockerfile.in (the .in as a reminder that it will be variable
substituted).

http://tracker.ceph.com/issues/10401 Fixes: #10401

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: ceph.spec.in or debian/control rebuild docker images

If any of the files in test/$os_type is newer than the creation date of
a docker image, the image is removed and rebuilt from scratch. For
instance, when a package is added to debian/control, the debian based
images are rebuilt.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: enable password-less sudo in containers

If compilation is run with ./configuire --enable-root-make-check, sudo
is expected to work without human interaction.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: deprecate docker-test.sh --compile option

It is redundant with the run-make-check.sh script and imposes additional
limitations.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: docker-test.sh commands are relative to git root

Instead of being in the src directory. Forcing the working directory to
src is convenient to run unittests individually without the need to
change directory, but it is confusing to the user.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: replace --enable-docker with --enable-root-make-check

The --enable-docker logic was that each test that needs privileges to
run uses a container to do so. The problem with this approach and
make -j8 check is that such tests compete for a single container.

The --enable-root-make-check activates tests that require privileges and
assume it is ok to use sudo to acquire privileges. The decision to run
in a container is then taken by the caller who will run something like:

   docker-tests.sh ./configure --enable-root-make-check
   docker-tests.sh make -j8 check

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: run-make-check.sh arguments are passed to configure

All run-make-check.sh arguments are transparently given to the configure
command. For instance:

    run-make-check.sh --enable-root-make-check

implies

    ./configure --enable-root-make-check

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: helpers to run make check in containers

Add scripts that run make check in a container for a given operating
system version. They are a little more than oneliners and serve two
purposes:

  * help new developers who do not have to figure out which options
    should be used

  * run make check in containers in parallel with make -j2

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: add xmlstarlet in containers

It can be removed once https://github.com/ceph/ceph/pull/3228 is merged
and xmlstarlet is found in ceph.spec.in and debian/control.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tests: avoid bash == --shell confusion in docker-test-helper.sh

Do not force interactive mode when the bash script is specified by the
user because it should be usable to run a small script instead of
starting an interactive shell session.

Signed-off-by: Loic Dachary <ldachary@redhat.com>