It turns out this test has not been triggering the right code path for
a while now (krbd_parent_overlap.t was added just over a year ago, but
the original test goes back a few years).
To do its job it needs an empty clone with the overlap set to somewhere
in the middle of an object. The test relied on shrinking for this, but
shrinking no longer fits the bill because a copyup is now performed for
the object with the overlap -- we never go to the parent after that.
Let's size the parent so that it ends in the middle of an object and
then grow an empty clone instead. Also, while reading from page cache
does seem to trigger a read that straddles the overlap, it's not very
reliable, so supplement it with a direct read.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Discard no longer guarantees zeroing, use BLKZEROOUT and "fallocate -z"
instead (blkdiscard(8) in xenial doesn't support -z).
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
We've had multiple overflows in ceph_calc_file_object_mapping().
It wasn't being used by rbd, but it now is.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
The block layer used to not enforce ioctl(BLKROSET) and set_disk_ro().
This has been fixed in 4.16-rc1.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
/bin/bash is a Linuxism. Other operating systems install bash to
different paths. Use /usr/bin/env in shebangs to find bash.
Signed-off-by: Alan Somers <asomers@gmail.com>
Make g_conf.keyring a plain old string rather than an array of strings.
Don't do substitution using the user's HOME variable-- this could lead
to security holes for setuid processes.
Get rid of AuthMonitor::read_keyfile because there is already a Keyring
member function, Keyring::load, that does the same thing.
qa/rbd/common.sh: we can now use cconf to figure out what the keyring
is.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>