librbd: add method to get the size of an image

To go with the other individual properties instead of stat,
add a method that only gets the size.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librbd: check for new snapshots in snap_set

This allows callers to create a snapshot and then read from
it immediately. No one uses this other than the tests,
fortunately.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: fix copy-pasted snap remove error message

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librbd: refactor synchronous I/O

Write in terms of the asynchronous functions, so all the logic
is not duplicated. Now there's only a single point where each
operation needs to change for layering.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
secret: return error on empty secret

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
rbd: fix off-by-one error in key name

Fixes: #2846
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
osd: peering: detect when log source osd goes down

The Peering state has a generic check based on the prior set osds that
will restart peering if one of them goes down (or one of the interesting
down ones comes up).  The GetLog state, however, can pull the log from
a peer that is not in the prior set if it got a notify from them (e.g., an
osd in an old interval that was down when the prior set was calculated).
If that osd goes down, we don't detect it and will block forward.

Fix by adding a simple check in GetLog for the newest_update_osd going
down.

(BTW GetMissing does not suffer from this problem because
peer_missing_requested is a subset of the prior set, so the Peering check
is sufficient.)

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
doc: Correct Git URL for clone

Using git@github.com would mean SSHing in, and your average open
source consumer probably won't have a Github account.

Using HTTPS offers the best combination of resisting man-in-the-middle
attacks and passing through corporate firewalls.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Tommi Virtanen <tv@inktank.com>
doc: Simplify submodules explanation.

``git clone --recursive`` does ``init`` & ``update`` for us. Also
avoids incorrect language; there never were submodules called ``init``
and ``update``.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
doc: Say what to do if submodules are out of date.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
doc: cd to repository before running git status.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
Revert "osd: peering: detect when log source osd goes down"

This reverts commit 0d3d75ec0d17e2f6bc5d42058f51eb2ff19ffb71.

Accidental double push.
ceph-authtool: Fix usage, it's --print-key not --print.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
rgw_admin.cc: Disallow addition of S3 keys with subuser creation

Fixes: #1855
It is no longer possible to create a subuser and new S3 key associated
with that user through the radosgw-admin utility. In reference to Bug 1855
http://tracker.newdream.net/issues/1855.

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
Signed-off-by: caleb miles <caleb.miles@inktank.com>
doc: Fix toctree structure for man obsync(1).

Signed-off-by: Tommi Virtanen <tv@inktank.com>
doc: mount.ceph is also needed for cephx.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
doc: Explicitly state mount.ceph two first arguments are fixed.

I've hurt myself too many times with this.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
rados.py: add binding for rados_trunc

Fixes: #2909
Signed-off-by: Evan Felix <evan.felix@pnnl.gov>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librbd: implement read/write from parent images

Put the completion handling logic into new subclases of
librbd::AioRequest, so the caching/non-caching paths can share
logic. These AioRequests replace AioBlockCompletion as representing
the I/O to a single object in an RBD image.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librbd: don't open parent again during get_parent_info

The parent was already opened when the original ImageCtx
was initialized. We just need to lookup the pool and image
name for it.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>