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().
Jason Dillaman [Mon, 20 Apr 2015 16:40:33 +0000 (12:40 -0400)]
cls_rbd: get_features needs to support legacy negative tests
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>
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:
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.
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.
Jason Dillaman [Fri, 17 Apr 2015 00:55:53 +0000 (20:55 -0400)]
tests: separate check_PROGRAMS from TESTS
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>
Danny Al-Gaaf [Fri, 10 Apr 2015 09:25:12 +0000 (11:25 +0200)]
test_async_driver.cc: fix UNINIT
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>
Danny Al-Gaaf [Wed, 18 Mar 2015 14:03:28 +0000 (15:03 +0100)]
rgw_rest_user.cc: UserQuotas init vars in ctor init list
Fix for:
[src/rgw/rgw_rest_user.cc:631]: (performance) Variable 'bucket_quota' is
assigned in constructor body. Consider performing initialization in
initialization list.
[src/rgw/rgw_rest_user.cc:632]: (performance) Variable 'user_quota' is
assigned in constructor body. Consider performing initialization in
initialization list.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Tue, 17 Mar 2015 21:58:19 +0000 (22:58 +0100)]
libcephfs.h: fix unnecessary forward declarations
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>
Danny Al-Gaaf [Tue, 17 Mar 2015 16:12:04 +0000 (17:12 +0100)]
rgw_rest_log.h: remove http_ret from some RGWOp_*_list classes
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>
ceph-disk: set '--cluster=ceph' in 'prepare' subcommand
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.
Ken Dreyer [Tue, 14 Apr 2015 16:22:37 +0000 (10:22 -0600)]
Merge pull request #4359 from ceph/wip-fix-ceph-dencoder-build-master
Move ceph-dencoder build to client
Rework mds/Makefile.am to support a dencoder client build
rgw/Makefile.am: Populate DENCODER_SOURCES properly
Dencoder should never be built with tcmalloc
Reviewed-by: Sage Weil <sage@redhat.com> Reviewed-by: Ken Dreyer <kdreyer@redhat.com>
Boris Ranto [Mon, 13 Apr 2015 13:07:03 +0000 (15:07 +0200)]
Rework mds/Makefile.am to support a dencoder client build
The patch adds all the mds sources to DENCODER_SOURCES to allow a
dencoder client build. The patch also splits the Makefile.am file to
better accomodate the change.
Dencoder is built if ENABLE_CLIENT is set. However, the rgw/Makefile.am
populated DENCODER_SOURCES only if WITH_RADOSGW was set. The patch fixes
this and populates DENCODER_SOURES if ENABLE_CLIENT is set.
Yehuda Sadeh [Fri, 27 Mar 2015 23:32:48 +0000 (16:32 -0700)]
rgw: generate new tag for object when setting object attrs
Fixes: #11256
Backport: firefly, hammer
Beforehand we were reusing the object's tag, which is problematic as
this tag is used for bucket index updates, and we might be clobbering a
racing update (like object removal).
Ken Dreyer [Mon, 13 Apr 2015 15:43:11 +0000 (09:43 -0600)]
packaging: ship systemd/ceph.tmpfiles.d in tarballs
Prior to this commit, the tarballs did not contain
any files under the top-level "systemd" directory. This caused problems
with RPM builds on Fedora and RHEL 7, because as of commit aa88364f30e2d2f254ade185a83ba263b48e2a73, those RPMs depend on the
systemd/ceph.tmpfiles.d file.
(Longer-term we might want to improve the tarball generation code to be
less complex/manual.)
http://tracker.ceph.com/issues/11383 Refe: #11383
Reported-by: Greg Farnum <gfarnum@redhat.com> Signed-off-by: Ken Dreyer <kdreyer@redhat.com>