ceph.in: remove '--' from injectargs, if there, as well

Fixes: #9976
Reviewed-by: Sage Weil <sage@redhat.com>
Signed-off-by: Dan Mick <dan.mick@redhat.com>
tools: skip up to expire_pos in journal-tool

Previously worked for journals starting from an
object boundary (i.e. freshly created filesystems)

Fixes: #9977
Signed-off-by: John Spray <john.spray@redhat.com>
osdc: fix Journaler write error handling

Since we started wrapping the write error
handler in a finisher, multiple calls to
handle_write_error would hit the assert()
on the second call before the actual
handler had been called (at the other end
of the finisher) from the first call.

The symptom was that the MDS was intermittently
failing to respawn on blacklist, seen in #10011.

Signed-off-by: John Spray <john.spray@redhat.com>
Merge pull request #2853 from ceph/wip-9977

tools: skip up to expire_pos in journal-tool

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Merge pull request #2870 from ceph/wip-blacklist-respawn

osdc: fix Journaler write error handling

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
tools: fix MDS journal import

Previously it only worked on fresh filesystems which
hadn't been trimmed yet, and resulted in an invalid
trimmed_pos when expire_pos wasn't on an object
boundary.

Fixes: #10025

Signed-off-by: John Spray <john.spray@redhat.com>
tools: persist trimmed_pos in journal dump

...rather than inferring something from expire_pos
that could leave trash behind in the range between
the original trimmed_pos and expire_pos.

Be backward compatible with old journal dumps
so that if someone is updating for other reasons
like getting better tools, they can still import
their journal.

Signed-off-by: John Spray <john.spray@redhat.com>
tools: error handling on journal import/export

Actually propagate nonzero returns codes!  Also
add checks on return values of I/O functions so
that someone doesn't think they've successfully
exported a journal if they haven't, and some
validation of the header pointers during import
so that people find out with a nice error
instead of an assertion if something is up.

Signed-off-by: John Spray <john.spray@redhat.com>

Fix compile issue in the position value cout.

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
qa/workunits/fs/misc: combine sudo and echo effectively

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit abc995b6b4e0117b74c301abcb4faf4ea2ebef25)
qa/workunits/cephtool/test.sh: ceph, not ./ceph

Fixes: #10053
Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2878 from ceph/wip-10025

#10025 Fix 'journal import' (aka undump)

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
0.88
Revert "osd: detect (some) misordered ondisk tmaps"

This reverts commit 10b68b2e1a1479c478843fab8232537675053c9b.

The check for 'nextkey < last_disk_key' makes not much sense since
last_disk_key is an empty string and not set before. Comparing a
decoded string to be less than an empty string will be never true.

Since this if() isn't part of a loop last_disk_key is only set
once and there is no other consumer: revert this dead code.

Conflicts:
	src/osd/ReplicatedPG.cc
Merge pull request #2897 from ceph/wip-da-revert-10b68b

Revert "osd: detect (some) misordered ondisk tmaps"

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Samuel Just <sjust@redhat.com>
doc/release-notes: v0.88

Signed-off-by: Sage Weil <sage@redhat.com>
Merge remote-tracking branch 'gh/next'
qa: allow small allocation diffs for exported rbds

The local filesytem may behave slightly differently. This isn't
foolproof, but seems to be reliable enough on rhel7 rootfs, where
exact comparison was failing.

Fixes: #10002
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
Merge pull request #2899 from jdurgin/wip-import-export-next

qa: allow small allocation diffs for exported rbds

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
osd/OSDMap: add osd_is_valid_op_target()

Helper to check whether an osd is a given op target for a pg.  This
assumes that for EC we always send ops to the primary, while for
replicated we may target any replica.

Signed-off-by: Sage Weil <sage@redhat.com>
osd/OSD: use OSDMap helper to determine if we are correct op target

Use the new helper.  This fixes our behavior for EC pools where targetting
a different shard is not correct, while for replicated pools it may be. In
the EC case, it leaves the op hanging indefinitely in the OpTracker because
the pgid exists but as a different shard.

Fixes: #9835
Signed-off-by: Sage Weil <sage@redhat.com>