rgw: don't turn 404 into 400 for the replicalog api

404 is not actually a problem to clients like radosgw-agent, but 400
implies something about the request was incorrect.

Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
OSDMonitor: be a little nicer about letting users do pg splitting

We were previously blocking pg splits whenever pg creations were in-
progress, but we only really need to avoid splitting any pgs which are
currently being created. Let the user set a different pg_num if there
are no creating PGs on the pool in question.

Fixes: #6673, take two

Signed-off-by: Greg Farnum <greg@inktank.com>
Merge pull request #802 from ceph/wip-6673b
(manually merged after next branch rebuilt)

OSDMonitor: be a little nicer about letting users do pg splitting

Reviewed-by: David Zafman <david.zafman@inktank.com>
qa: don't run racy xfstest 008

This test attempts to generate a random number of holes within a
particular range, but may fail because hole placement is random.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: omit 'rw' option during map

The ro and rw options were added in linux 3.7. To be compatible with
older kernels, don't specify rw. The default will probably always be
rw, so this should not present any problems in the future.

Reported-by: nicolasc <nicolas.canceill@surfsara.nl>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #804 from jdurgin/wip-rgw-replica-log-next

rgw: don't turn 404 into 400 for the replicalog api

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Merge pull request #807 from jdurgin/wip-rbd-map-rw

rbd: omit 'rw' option during map

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #806 from jdurgin/wip-xfstests

Don't run racy xfstest 008
mon/PGMap: use const ref, not pass-by-value

Signed-off-by: Sage Weil <sage@inktank.com>
osd/erasurecode: correct one variable name in jerasure_matrix_to_bitmatrix()

When bitmatrix is NULL, this function returns NULL.

Signed-off-by: Xing Lin <xinglin@cs.utah.edu>
Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #809 from ceph/wip-pgmap

Reviewed-by: Greg Farnum <greg@inktank.com>
ReplicatedPG::recover_backfill: adjust last_backfill to HEAD if snapdir

Otherwise, if last_backfill_started is a snapdir, we will fail to send a
transaction for a client IO creating the head object and removing the
snapdir object.  The result will be that head will eventually be
backfilled, but the snapdir object will erroneously not be removed.

Fixes: #6685
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
OSD: don't clear peering_wait_for_split in advance_map()

I really don't know why I added this...  Ops can be discarded from the
waiting_for_pg queue if we aren't primary simply because there must have
been an exchange of peering events before subops will be sent within a
particular epoch.  Thus, any events in the waiting_for_pg queue must be
client ops which should only be seen by the primary.  Peering events, on
the other hand, should only be discarded if we are in a new interval,
and that check might as well be performed in the peering wq.

Fixes: #6681
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
OSD: allow project_pg_history to handle a missing map

If we get a peering message for an old map we don't have, we
can throwit out: the sending OSD will learn about the newer
maps and update itself accordingly, and we don't have the
information to know if the message is valid. This situation
can only happen if the sender was down for a long enough time
to create a map gap and its PGs have not yet advanced from
their boot-up maps to the current ones, so we can rely on it

Fixes: #6712
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
galois.c: fix compiler warning

galois_create_split_w8_tables() takes no parameter, remove '8' passed
to the function in one case.

osd/ErasureCodePluginJerasure/galois.c: In function 'galois_w32_region_multiply':
osd/ErasureCodePluginJerasure/galois.c:696:5: warning: call to function 'galois_create_split_w8_tables' without a real prototype [-Wunprototyped-calls]
In file included from osd/ErasureCodePluginJerasure/galois.c:53:0:
osd/ErasureCodePluginJerasure/galois.h:71:12: note: 'galois_create_split_w8_tables' was declared here

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Merge pull request #814 from ceph/wip-da-fix-galois-warning

galois.c: fix compiler warning

Reviewed-by: Loic Dachary <loic@dachary.org>
FileStore::_collection_move_rename: handle missing dst dir on replay

In case of a replay, a missing destination directory indicates that
the destination object and directory have been removed by a later
transaction.  Thus, we need to remove the src object and return
0.

Fixes: #6714
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
osdmaptool: don't put progress on stdout

If one requests JSON output, the progress message pollutes the output;
don't do that, send it to stderr instead

Signed-off-by: Dan Mick <dan.mick@inktank.com>
RadosModel: use sharedptr_registry for snaps_in_use

There might be two concurrent rollback ops each of which
adds snap x to snaps_in_use.  Between when the first
completes and the second completes, snap x may be removed
since the first would have removed snap x from snaps_in_use.
Using sharedptr_registry here avoids this by ensuring that
the snap won't be removed from snaps_in_use until all refs
are gone.

This patch also adds size() to sharedptr_registry.

Fixes: #6719
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
Merge pull request #824 from dmick/next

osdmaptool: don't put progress on stdout

Reviewed-by: Sage Weil <sage@inktank.com>