OSD,PG: lock_with_map_lock_held() is the same as lock()

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG: reassert_lock_with_map_lock_held() is dead

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG: rename must_delay_request to op_must_wait_for_map, make static

Signed-off-by: Samuel Just <sam.just@inktank.com>
PG,OSD: delay ops for map prior to queueing in the OpWQ

Previously, we simply queued ops in the OpWQ without checking.  The PG
would then check in do_request whether the message should wait for a new
map.  Unfortunately, this has the side effect that any op requeued for
any reason must also requeue the waiting_for_map queue.

Now, we will check before queueing the op whether it must wait on a map.
To avoid contention, there is now a map_lock which must be held along
with the PG lock in order to update the osdmap_ref.  The map_lock also
protects the waiting_for_map list and queueing PG ops at the back of
the OpWQ.  A few details:
1) It is no longer necessary to requeue waiting_for_map in on_change()
since the other ops are queued at the front.
2) Once waiting_for_map is non-empty, all ops are delayed to simplify
ordering.
3) waiting_for_map may now be non-empty during split, so we must split
waiting_for_map along with waiting_for_active.  This must be done
under the map_lock.

The bug which uncovered this involved an out of order op as follows:

client.4208.0:2378 (e252) arrives, object is degraded
client.4208.0:2379 (e253) arrives, waits for map
client.4208.0:2378 (e252) is requeued after recovery
client.4208.0:2379 (e253) is requeued on map arrival
client.4208.0:2379 is processed
client.4208.0:2378 is processed

Fixes: #4955
Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge branch 'wip_4955' into next

Reviewed-by: Sage Weil <sage@inktank.com>
qa: rsync test: exclude /usr/local

Some plana have non-world-readable crap in /usr/local/samba.  Avoid
/usr/local entirely for that and any similar landmines.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: Monitor: tolerate GV duplicates during conversion

Fixes: #4974

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge pull request #278 from ceph/wip-4974

Reviewed-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
mon: fix validatation of mds ids in mon commands

Fixes: #4996
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #280 from ceph/wip-4996

Reviewed-by: Joao Luis <joao.luis@inktank.com>
SimpleThrottle: fix -ENOENT checking

The condition was reversed. Rewrite it so it's clear that we're
ignoring -ENOENT only when m_ignore_enoent is set.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
PG: subset_last_update must be at least log.tail

Fixes: 5020
Backport: bobtail, cuttlefish
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
PG: fix some brace styling

Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
Merge pull request #281 from ceph/wip-rbd-rm-enoent

Reviewed-by: Sage Weil <sage@inktank.com>
Merge remote-tracking branch 'gh/next'
Merge git://github.com/ceph/ceph