Fixes: #11435
A complete multipart upload should not succeed if parts were not
specified. Also, adjust return codes.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
If ImageCtx::init() fails, perf counters are still used when closing
the image. To prevent uninitialized use, it's easiest to always
initialize them before anything that can fail in ImageCtx::init().
This was moved in 6055df3985, but it's
not necessary to delay perf counter initialization for any extra
configuration.
Fixes: #11433
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
During Ceph upgrade testing, older Ceph test suites assume that
get_features will return -ENOENT if provided a missing snapshot.
Support these negative tests until the older releases are no
longer supported.
Fixes: #11380
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
average_util should be calculated from the same set of nodes that
dump_item considers when calculating the stddev.
While here, remove unnecessary check for kb > 0:
get_bucket_utilization returns false if kb <= 0.
Also, update get_bucket_utilization accordingly to the preferred
convention to use pointers and not references for output arguments.
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Add a test to exercise rbd unmap. This was inspired by and is mostly
for rbd unmap <image-name> (aka spec), but rbd unmap <device> is tested
as well. Any significant change to krbd.cc or corresponding rbd cli
should be tested in the following three configurations at least:
- kernel < 3.14
- kernel >= 3.14, rbd.single_major=N
- kernel >= 3.14, rbd.single_major=Y
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Make use of krbd_unmap_by_spec() and allow unmapping by <image-name>
(i.e. pool/image@snap spec) with a bunch of careful adjustments to the
fragile command args/options parsing process to make --pool, --image
and --snap options work as expected for rbd unmap <image-name> case.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Make unmapping by (pool, image, snap) spec possible. For specs mapped
multiple times unmap one device per krbd_unmap_by_spec() call.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Current client code relies on cap message to trim unlinked inode
from cache. This method is too sensitive to message ordering. If
client receives the cap message while directory inode still contains
dentries that are referenced by unsafe requests, the inode can't
get trimmed.
The fix is, when rmdir/rename request finishes, try trimming the
unlinked inode again.
Fixes: #11339
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Not all programs that should be built during 'make check' should
be executed as tests. A new variable, check_TESTPROGRAMS, was
introduced to specify which programs should be executed as a test
during a 'make check'.
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
When printing a non-existing key, ceph-authtool exits with a success
value:
[root@ip-172-31-3-178 ~]# ceph-authtool /etc/ceph/ceph.mon.keyring -p -n
client.doesntexist ; echo $?
entity client.doesntexist not found
0
Expected result: 1
Signed-off-by: Gerhard Muntingh <gerhard@qux.nl>
Fix for:
CID 1254380 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value sa. Field
sa.sin_zero is uninitialized when calling connect
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use memset to fill integer VLAs.
Fix for:
CID 1219649 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value primary_count[primary]
CID 1219648 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value first_count[osds[0UL]]
CID 1219647 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value count[osds[i]]
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>