ReplicatedPG::C_OSD_CommittedPushedObject take epoch submitted

What we really care about is that the epoch in which the Context
was submitted is at complete() time >= last_peering_reset.

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::C_OSD_CommittedPushedObject: use intrusive_ptr for pg

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG::build_scrub_map: detect race with peering via last_peering_reset

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG,ReplicatedPG: use pg_has_reset_since to discard old async events

Local async events are obsolete if the pg is deleting or if the
epoch at which they were created is prior to last_peering_reset.

Signed-off-by: Samuel Just <sam.just@inktank.com>
systest: fix race with pool deletion

The second test have pool deletion and object listing wait on the same
semaphore to connect and start. This led to errors sometimes when the
pool was deleted before it could be opened by the listing process. Add
another semaphore so the pool deletion happens only after the listing
has begun.

Fixes: #4147
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit b0271e390564119e998e18189282252d54f75eb6)
systest: restrict list error acceptance

Only ignore errors after the midway point if the midway_sem_post is
defined.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit 5b24a68b6e7d57bac688021b822fb2f73494c3e9)
Merge remote-tracking branch 'gh/wip-4249' into next
ceph.spec.in:  Create placeholder directorys under /var/lib/ceph (Bug 4119)

Signed-off-by: Gary Lowell  <gary.lowell@inktank.com>
Monitor.cc: use empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Monitor.h: use empty() instead of !size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Paxos.cc: use empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mon_store_converter.cc: use empty() instead of size()

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
FileStore.cc: use if(!empty()) instead of if(size())

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
ReplicatedPG.cc: use empty() instead of size() == 0

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
KeyValueDBMemory.cc: use empty() instead of size() == 0

Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/journal.cc: fix assert in replay()

Fix assert in replay(), check if mds->sessionmap.version is cmapv
instead of assign cmapv to  mds->sessionmap.version. Add missing
second '='.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
crushtool.cc: remove unneeded function declaration

Remove unneeded function declarations (data_analysis() is unused and
usage() is not needed).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CephxProtocol.cc: catch error by reference

Follow 'Throw by value, catch by reference' to void copying and
potential slicing the exception.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CephxProtocol.cc: catch end_of_buffer by reference

Follow 'Throw by value, catch by reference' to void copying and
potential slicing the exception.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Client.cc: add parenthesis around expression

Add parenthesis around expressions like (x && y & z).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>