On trusty 14.04, service works but invoke-rc.d does not (but is present).
Fixes: #11330
Reported-by: Wim Heirman <wim@heirman.net>
Signed-off-by: Sage Weil <sage@redhat.com>
When a command fail as it should but it does not contain the expected
output, display the entire output to confirm it's a false negative.
http://tracker.ceph.com/issues/11441Fixes: #11441
Signed-off-by: Loic Dachary <ldachary@redhat.com>
A proxied flatten request could be replayed, resulting in a
-EINVAL error code being generated on the second attempt. Filter
out that error if it is known the parent did exist before the
op started.
Fixes: #11370
Backport: hammer
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
this change fixes the "store-copy" command.
Like the bug reported in http://tracker.ceph.com/issues/10093.
Signed-off-by: huangjun <hjwsm1989@gmail.com>
If snap inode exists, capability's client_follow has already been
updated by MDCache::cow_inode(). So we only update client_follow
when the inode was not COWed.
Besides, we need to check return of SnapRealm::get_snap_following().
It can return CEPH_NOSNAP, which is clearly invalid for client_follows.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
the snapid check in Locker::_do_null_snapflush() prevents us from
flushing old snap inodes. The check does not make sense.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
this avoids assert(!dn->state_test(CDentry::STATE_PURGING)) in
eval_stray() being triggered when processing the delayed list.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Fixes: #11437
Don't deal with end_marker if there's a namespace set for the object
listing. The cur_end_marker.empty() check is incorrect if no end_marker
is provided, but a namespace is set. Just avoid this issue entirely, as
it's not needed.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
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>
Init variable with NULL to make sure it crashes in error
case (would be a bug) if NDEBUG disable the assert() call.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This is caused by assert(). If assert is disabled we run into use
of uninitialized variables. Return -EINVAL in case assert() is
disabled.
Fix for:
[src/client/Client.cc:7791]: (error) Uninitialized variable: lock_state
[src/client/Client.cc:7829]: (error) Uninitialized variable: lock_type
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This is an issue in case non-cpp code. Move the declaration of
inodeno_t and vinodeno_t structs into __cplusplus block where
they are needed.
Fix for cppcheck issue:
[src/include/cephfs/libcephfs.h:89] -> [src/include/cephfs/libcephfs.h:74]:
The struct 'inodeno_t' forward declaration is unnecessary. Type struct is
already declared earlier.
[src/include/cephfs/libcephfs.h:93] -> [src/include/cephfs/libcephfs.h:83]:
The struct 'vinodeno_t' forward declaration is unnecessary. Type struct is
already declared earlier.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
All places COMMIT_SNAP_ITEM is used the variables are
'unsigned long long'. Change the format qualifier to reflect
this and to fix:
[src/os/FileStore.cc:1341]: (warning) %lld in format string (no. 1)
requires 'long long *' but the argument type is 'unsigned long long *'.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Use sizeof(char) instead of sizeof('\0').
Fix for:
[src/test/objectstore/chain_xattr.cc:164]: (warning) Suspicious
usage of 'sizeof' with a numeric constant as parameter.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Remove http_ret from child class since there is already an integer
with the same name in the parent/base class.
Fix for:
[src/rgw/rgw_rest_log.h:79] -> [src/rgw/rgw_rest.h:275]: (warning) The
class 'RGWOp_MDLog_List' defines member variable with name 'http_ret'
also defined in its parent class 'RGWRESTOp'.
[src/rgw/rgw_rest_log.h:99] -> [src/rgw/rgw_rest.h:275]: (warning) The
class 'RGWOp_MDLog_Info' defines member variable with name 'http_ret'
also defined in its parent class 'RGWRESTOp'.
[src/rgw/rgw_rest_log.h:182] -> [src/rgw/rgw_rest.h:275]: (warning) The
class 'RGWOp_DATALog_List' defines member variable with name 'http_ret'
also defined in its parent class 'RGWRESTOp'.
[src/rgw/rgw_rest_log.h:202] -> [src/rgw/rgw_rest.h:275]: (warning) The
class 'RGWOp_DATALog_Info' defines member variable with name 'http_ret'
also defined in its parent class 'RGWRESTOp'.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
otherwise the 'ceph' default value won't be catched by "main_prepare()",
this breaks TEST_corrupt_and_repair_replicated. seems the behaviour
was changed in python 2.7.9, so we move the default value to where
the '--cluster' argument is added instead of setting it in the
main argument parser.
Signed-off-by: Kefu Chai <kchai@redhat.com>