OSD: disconnect_session_watches: handle race with watch disconnect

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Tested-by: Stefan Priebe <s.priebe@profihost.ag>
mon: MonmapMonitor: Use default port when the specified on 'add' is zero

Fixes a bug triggered by using the ceph tool to 'mon add' with a port set
to zero. We now default to the monitor's default port (6789) instead, and
we will fail if that port is already assigned to some other monitor.

Fixes: bug #2661

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
doc/config-cluster/authentication: keyring default locations, simplify key management

- keyrings have new default locations that everyone should use.
- the user key setup is vastly simplified if you use the
  'ceph auth get-or-create' command.

Signed-off-by: Sage Weil <sage@inktank.com>
debian: build with libnss instead of crypto++

Signed-off-by: Laszlo Boszormenyi (GCS) <gcs@debian.hu>
debian: arch linux-any

Signed-off-by: Sage Weil <sage@inktank.com>
debian: move mount.ceph and cephfs into ceph-fs-common

Based on patches from Laszlo Boszormenyi (GCS) <gcs@debian.hu>.

Signed-off-by: Sage Weil <sage@inktank.com>
debian: move metadata server into ceph-mds

Also adjust the recommends and depends, so that libcephfs1 and ceph-fuse
hang off of ceph-mds instead of ceph.

Signed-off-by: Sage Weil <sage@inktank.com>
filestore: sync object_map object in lfn_remove when nlink > 1

In the following sequence:

1) create (a, 1)
2) setattr (a, 1)
3) link (a, 1), (b, 1)
4) remove (a, 1)

If we play 1-4 and then replay 1-4 again, we will end up removing
(b, 1)'s attributes since nlink for (a, 1) the second time through
is 1.  We fix this by marking spos on the object_map header for
(a, 1) when we remove (a, 1) but not eh attributes.

Signed-off-by: Samuel Just <sam.just@inktank.com>
DBObjectMap: clones must inherit spos from parent

Signed-off-by: Samuel Just <sam.just@inktank.com>
rest-bench: mark request as complete later

We marked a request as complete in the callback, however
it might be that we're still inside S3_runall_request_context()
which means that request is not really complete yet.
Possibly fixes bug #2652.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
mon: 'osd pool rename <oldname> <newname>'

Signed-off-by: Sage Weil <sage@inktank.com>
osd: handle pool name changes properly

 * Remove the old name from the name->id map.

Fixes: #2676
Signed-off-by: Sage Weil <sage@inktank.com>
osdmap: check new pool name on rename

Ensure the new pool name doesn't already exist, both in the current and
project map.

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

Signed-off-by: Sage Weil <sage@inktank.com>
MOSDSubOp: set hobject_incorrect_pool in decode_payload

Signed-off-by: Samuel Just <sam.just@inktank.com>
OSD::do_command: unlock pg only if we had it

Signed-off-by: Samuel Just <sam.just@inktank.com>
mon: initialize quorum_features

This could cause us to incorrectly encode new features into the monstore
that an old mon won't understand.

This is overly conservative; we probably need to persist the set of quorum
features that are supported and use those.

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: move to STANDBY if we replace during accept and then fail

If we replace an existing pipe during accept() and then fail, move to
STANDBY so that our connection state (connect_seq, etc.) is preserved.
Otherwise, we will throw out that information and falsely trigger a
RESETSESSION on the next connection attempt.

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: do not try to reconnect con with CLOSED pipe

If we have a con with a closed pipe, drop the message.  For lossless
sessions, the state will be STANDBY if we should reconnect.  For lossy
sessions, we will end up with CLOSED and we *should* drop the message.

Signed-off-by: Sage Weil <sage@inktank.com>
msgr: fix pipe replacement assert

We may replace an existing pipe in the STANDBY state if the previous
attempt failed during accept() (see previous patches).

This might fix #1378.

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