rbd.cc: propagate some errors to user-space when they're available

There was a bunch of situations in which we would have a proper error to
propagate to user-space but we would always return '1' (EXIT_FAILURE).

Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
(cherry picked from commit 7e722245a717038c49f432ae19d9874c25066bb6)
Objecter: add "honor_cache_redirects" flag covering cache settings

When set to false, we do not redirect based on the cache_pool data
in the OSDMap. We'll use this so the OSDs can actually fetch data
into the cache pools on promotion!
Signed-off-by: Greg Farnum <greg@inktank.com>
OSD: unset_honor_cache_redirects() on Objecter

Signed-off-by: Greg Farnum <greg@inktank.com>
common/SloppyCRCMap: add type to sloppily track crcs

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

sloppy
rgw: fix leak in RGWMetadataManager::remove()

Backport: dumpling
Fixes: #6445
handler->get() returns a newly allocated obj, need to delete it when
done.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
ReplicatedPG: use our already-found iterator instead of going back into map

We have an iterator pointing at the element we want; no need to search
the map again in order to grab the element or remove it.

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: remove useless pcop param from start_copy

Signed-off-by: Greg Farnum <greg@inktank.com>
ReplicatedPG: remove unused CopyOp::waiting member, rename function for accuracy

We never placed any ops here, and so we weren't ever requeuing any ops.

Signed-off-by: Greg Farnum <greg@inktank.com>
Invoke python with /usr/bin/env python instead of directly

Fixes: #6311
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Merge pull request #661 from ceph/wip-copy-cleanups

Wip copy cleanups

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #662 from dmick/next

Invoke python with /usr/bin/env python instead of directly
librados: pool async create / delete does not delete completion handle

Backport: dumpling
The pool async delete / create function used to delete the internal
completion object. However, caller still holds the allocated completion
object, which it can't drop a reference to (as it'd try to deallocate
the already freed internal object). This fix removes the internal object
deletion, a following commit will fix a related leak (#6444) by having
the application (radosgw) drop the reference even if got an error.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rgw: drop async pool create completion reference

Fixes: #6444
Backport: dumpling
If pool creation fails (e.g., due to -EEXIST) then we leak the
completion object. Earlier we couldn't just drop the reference, as
librados have already removed the internal completion object. This fix
drop the completion reference even if got an error, which is now
possible.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
os/FileStore: add sloppy crc tracking

Opportunistically track CRCs for data we write and verify it for data
we read.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #660 from ceph/wip-fs-crc

sloppy / opportunistic CRC tracking in the filestore

Reviewed-by: Samuel Just <sam.just@inktank.com>
PendingReleaseNotes: update regarding librados change

Fix related to issue #6444

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
rbd.cc: add readonly option for "rbd map"

The device could only be set to rw(default) when mapping
now. This patch only handle the user space, because the
kernel part has been completed.

Signed-off-by: Guangliang Zhao <guangliang@unitedstack.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #665 from ceph/wip-6444

Wip 6444
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
ceph_argparse.py: clean up error reporting when required param missing

Treat "need 1, got 0" as a special case, and change the message to
"missing required parameter <x>".  Also, when failing for that reason,
print the command concise description and its helptext.

Fixes: #6384
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Merge pull request #664 from ceph/wip-6445

Wip 6445
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>