cls_rbd: make sure stripe_unit is not larger than object size

Test a few other cases too.

backport: cuttlefish, bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd.py: fix stripe_unit() and stripe_count()

These matched older versions of the functions, but would segfault
using the current versions.

backport: cuttlefish, bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librbd: make image creation defaults configurable

Programs using older versions of the image creation functions can't
set newer parameters like image format and fancier striping.

Setting these options lets them use all the new functionality without
being patched and recompiled to use e.g. rbd_create3().
This is particularly useful for things like qemu-img, which does not
know how to create format 2 images yet.

Refs: #5067
backport: cuttlefish, bobtail
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
kv_flat_btree_async.cc: release AioCompletion before leave the loop

CID 727982 (#1 of 1): Resource leak (RESOURCE_LEAK)
  leaked_storage: Variable "aioc" going out of scope leaks the storage
  it points to.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
debian: stop sysvinit on ceph.prerm

Signed-off-by: Sage Weil <sage@inktank.com>
Use invoke-rc.d in maintainer scripts

Upstart configurations and sysv init scripts should be started and stopped
using invoke-rc.d in maintainer scripts.

This ensures the correct behaviour across both Debian (sysv) and Ubuntu (upstart)
and in restricted environments such as schroot where start/stop of services from
maintainer scripts is normally disabled.

Signed-off-by: James Page <james.page@ubuntu.com>
os/LevelDBStore: fix compression selection

We were always disabling compression.

Fixes: #5131
Reported-by: Sylvain Munaut <s.munaut@whatever-company.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #304 from javacruft/wip-invoke-rc.d

Use invoke-rc.d in maintainer scripts
Merge branch 'next'

Conflicts:
	debian/ceph.prerm
Merge pull request #303 from ceph/wip-librbd-config-create

Reviewed-by: Sage Weil <sage.weil@inktank.com>
ceph-monstore-tool: dump-keys command

Signed-off-by: Sage Weil <sage@inktank.com>
ceph-monstore-tool: compact command

Signed-off-by: Sage Weil <sage@inktank.com>
ceph-monstore-tool: be more verbose when replaying a trace

Signed-off-by: Sage Weil <sage@inktank.com>
rbd: prevent import of a dir

Fixes: #2865
Signed-off-by: Sage Weil <sage@inktank.com>
rbd image_read.sh: a few cleanups

The function boolean_toggle() in qa/workunits/rbd/image_read.sh is
defined but never used.  My intentions were good though.  Fix it and
use it for argument parsing.

Change the minimum supported object order so it matches what the
command line interface enforces.

Assign the initial value of TEST_CLONES from the environment if it's
available.

Change defaults to use format 2 and test clones.

Output details about the parameters of the run even if not being
verbose.

Make the order of assignment of argument variables consistent.

And fix a typo unmap_image().

Signed-off-by: Alex Elder <elder@inktank.com>
rbd image_read.sh: allocate local file at create time

Move the dd command that touches the last byte in a local file
into create_image() where it belongs (out of fill_original()).

Signed-off-by: Alex Elder <elder@inktank.com>
rbd image_read.sh: add clone-of-clone testing

Add testing to verify that a snapshot of a clone and a clone of
that snapshot both produce the correct results when read.

Signed-off-by: Alex Elder <elder@inktank.com>
rbd image_read.sh: test different clone object orders

An rbd clone image can be created with an object order that differs
from that of its parent.  This patch adds testing for that in
qa/workunits/rbd/image_read.sh.  By default, clone images will be
created with an object size twice as big as that of its parent.

For simplicity, when a clone's object order differs from its parent
the order will be either one more than or one less than that of its
parent image, meaning its object size is either double or half of
the size of objects used in the parent.

Signed-off-by: Alex Elder <elder@inktank.com>
ceph-disk: fix stat errors with new suppress code

Broken by 225fefe5e7c997b365f481b6c4f66312ea28ed61.

Signed-off-by: Sage Weil <sage@inktank.com>
ceph-fuse: add ioctl support

Signed-off-by: Andras Elso <elso.andras@gmail.com>